8 posts
  • Has been part of the Envato Community for over 1 year
  • Has collected 1+ items on Envato Market
inquisitive says

Hello,

Please let I know how to apply same css for more than one button on same page.

I have one button as follows which is working fine for single button:

<input id=”consubmit” type=”submit” name=”consubmit” value=”Sign In” onclick=”javascript:TestCodeBehind2()” />

Introducing another button on page like below :

<input id=”consubmit1” causesvalidation=”false” type=”submit” name=”consubmit1” value=”Cancel” onclick=”javascript:TestCodeBehind3()” />

If we change name and id for the button then that css not working properly.

Please let me know how to solve this issue.

Thanks

5 posts
  • Has been part of the Envato Community for over 2 years
  • Has referred 50+ members
  • Has sold $125,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+4 more
wellthemes says

I’m guessing that the CSS style is defined for the element with the id consubmit. So it will be applied to only those elements which have the same id. Since the second button has different id, thats why it is not being applied to that.

You can do that by two ways.

1. Use a common css class for the both buttons.

For example:
<input id="consubmit" class="button" type="submit" name="consubmit" value="Sign In" onclick="javascript:TestCodeBehind2()" /> 
<input id="onsubmit1" class="button" causesvalidation="false" type="submit" name="consubmit1" value="Cancel" onclick="javascript:TestCodeBehind3()" />
Now you can define the CSS for the button class.

2. If you don’t want to do that, you can copy the CSS code of #consubmit for #consubmit1.

Hope it helps.

8 posts
  • Has been part of the Envato Community for over 1 year
  • Has collected 1+ items on Envato Market
inquisitive says

It works when take up html input buttons. But the style does not get applied when we take a asp.net button control. For html input buttons, we do not have code behind like aspx page i.e. c# code. we cannot invoke the click event for which the code is written in c# file. So we need to make the style work for asp.net button control.

Please help.

310 posts
  • Has been part of the Envato Community for over 3 years
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in Portugal
DunKz says

Wellthemes is right,

Just need to put the style on .button { }

But make sure that don’t exist the same name already otherwise it will be replaced.

Regards

by
by
by
by
by
by