views:

23

answers:

1

Is it possible to set CSS for disabled textboxes? I don't want the automatic gray-out in Firefox/Chrome.

The reason is that I'm sometimes disabling textboxes right before submitting a form so they don't get unnecessarily transmitted (and clutter the URL), and that gray-out behavior is degrading the user experience by creating flicker.

Help?

A: 

You should be able to style the text box by defining a class with how you want it to look, and then adding the class when you disable the input. If you're not worried about IE6 compatibility, then try using attribute selectors:

input[disabled="disabled"] {
     /* your CSS style */
}

You should be able to use any styles you'd use on any other element.

derekerdmann