I have a button which is using a class formBtn
in css
.formBtn {color:#fff; background-color:#518ACD; border-color:#ccc #000 #000 #ccc; font- size:11px; font-weight:bold;}
in HTML
<html:submit styleClass="formBtn" value="Add"/>
Suggest me something so that I can use the same class name for a disabled button and show it in a different manner (say background-color:Grey). I may be using the style class like this
in HTML
<html:submit styleClass="formBtn" value="Disabled Add" disabled="true"/>
To make the disabled button, we will use the Pure CSS class “pure-button-disabled” with the class “pure-button”. We can also create a disabled button using disabled attribute. Disabled Button used Class: pure-button-disabled: It is used to disable the Pure CSS button.
To style a disabled element, you can use the following CSS selectors elementTag:disabled {/* CSS */} or elementTag[disabled] {/* CSS */} but as T.J.Crowder noted: it's difficult to interpret your question as to what, specifically, you want to do. It may be worth having a read of "How to Ask" for additional pointers.
You should use javascript or your templating engine to add and remove a "disabled" class to the label elements. It shouldn't be any difficult since having disabled elements already imply you are using some sort of programming with the forms.
Use the :disabled pseudoclass.
.formBtn:disabled { background-color: grey; }
[attribute=value] selector should work IE7, don't know about IE6 if you care.
.formBtn[disabled=true] { background: gray}
If you have "Disabled" word in values you could do something like:
.formBtn[value~=Disabled] { background: gray}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With