Custom disabling of SELECT element

liunx

Guest
I have a form that is poplulated with a dataset ONLOAD, and uses JavaScript to highlight any data items that are flagged as dirty (updated). I want all the form elements to be read-only, which works fine for <input> elements, but the <select> element doesn't have any sort of READONLY property. If I use the DISABLED property on the SELECT elements I cannot apply the highlighting because the DISABLED property overrides any style settings you apply.<br />
<br />
<br />
So my question is does anyone know a way to either:<br />
<br />
A) Override the style which the browser uses to render DISABLED <select> elements<br />
<br />
OR<br />
<br />
B) Some other way (Javascript, DHTML, ...) to make a <select> element appear to be read-only<br />
<br />
C) any other suggestion you might have.<br />
<br />
<br />
Luckily the pages are coded specifically for IE 6 so I don't have to worry about compatibility issues if you have a workaround...<!--content-->Try this:<br />
<br />
<select name="select1" onChange="return false;" style="background-color:#008800;"><br />
<option selected>This is selected</option><br />
<option>Bet you can't select this...</option><br />
<option>...or this...</option> <br />
</select><!--content-->
 
Back
Top