Say I had the following:
<select disabled="disabled" style="border: 1px red solid; color: black;">
<option>ABC</option>
</select>
Firefox renders the above with a red border and black text as I expect; but IE does not, it seems to be using native colors for the border and the disabled text. Is there any way for me to be able to style it?
For edit boxes my workaround was to use readOnly instead of disabled so that I can style it, but it seems for combo boxes the readOnly attribute has no effect.
Note: I only need this to work in IE (it's for an intranet webapp where users must use IE), so IE-specific solutions are fine.
If you enjoyed my content for some reason, I'd love to hear from you! Here are some options:
- You can buy me a coffee!
- Click here to post a comment!
- You can write a reply on your own site and submit the URL as a webmention via the form below.
- Or you can just contact me!
Referenced by
One possibility could be... Draw your combo box with in a 1 X 1 table and width equals to that of combo box and combo box width = 100%.. cellpadding=0, cellspacing=0... then draw your desired border around that table.
via stackoverflow.comTo a good approximation, you can't style comboboxes at all; they're not "real" browser objects. See here for more explanation, and a possible workaround: https://stackoverflow.com/questions/1072239/is-it-possible-to-style-a-select-box
Alternatively, if you just want to put borders on it, wrap it in a span, and border that.
with
Most other properties, like color, etc, probably won't have an effect, though.
via stackoverflow.comYour best option is to use javascript to control the items, I included a few scripts below:
http://info.wsisiz.edu.pl/~suszynsk/jQuery/demos/jquery-selectbox/
http://brilliantretail.com/cases/select/
http://www.emblematiq.com/projects/niceforms/
I've only ever used the first, but I hope they meet your needs.
via stackoverflow.com