I'd like change the CSS for disabled checkboxes in a grid (they are too hard to see for the users). What is a simple way to do this?
My preference in technologies used (in descending order):
CSS
JavaScript
jQuery
Other
I'd suggest changing the colour of the background (the background-color
of the form/fieldset), and see if you can come up with a better contrast. If you just want to change the colour of disabled (non-selectable?) checkboxes you can try:
input[disabled] {
...
/* CSS here */
...
}
But if they're disabled for a reason, surely they don't need to be prominently visible? The aim for their being greyed-out is, surely, to avoid confusion between active/enabled and inactive/disabled form elements?
Keep the checkbox enabled, but then add onfocus=this.blur()
to the checkbox so it cannot be clicked.
Or if using ASP.net (as you say in your comment) keep the checkbox set to enabled and add the following to the Page.Load event:
CheckBox1.Attributes.Add("onclick", "return false;");
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