8 posts
  • Has been part of the Envato Community for over 2 years
  • 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
  • Elite Author: Sold more than $75,000 on Envato Market
  • Sells items exclusively on Envato Market
  • Has sold $125,000+ on Envato Market
  • Located in Europe
+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 2 years
  • 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.

313 posts
  • Has been part of the Envato Community for over 4 years
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in Portugal
Generictec 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

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by