Matt wrote:
I want to know if readOnly attribute doesn't work for drop down list?
If I try disabled attribute, it works fine for drop down list. When I
try text box, it works fine for both disabled and readOnly attribute.
For example, #1 will work, but #2 doesn't work
1) <SELECT name="streetDirection" class="FormInput" DISABLED>
In JavaScript, I have InputForm.streetDirection.disabled = false;
2) <SELECT name="streetDirection" class="FormInput" readOnly>
In JavaScript, I have InputForm.streetDirection.readOnly= false;
any ideas? thanks!!
The readonly attribute appears to not be supported on <select> elements
by Firefox 0.9, IE6SP1 or Opera 7.51.
<url:
http://msdn.microsoft.com/workshop/a...cts/select.asp
/> confirms this by not listing "readonly/readOnly" as a valid property
on the <select> object.
<url:
http://www.w3.org/TR/html401/interac...html#h-17.12.2 /> also
seems to confirm this behavior: "The following elements support the
readonly attribute: INPUT and TEXTAREA."
That spec doesn't specifically exclude SELECT, but it doesn't include it
either, and the fact that none of the 3 user agents I tested support
readonly on <select> points to user agents adhering to the letter of the
spec.
In other words, what you are seeing is documented behavior.
Besides, what would be the point of a readonly <select>? It would appear
to be a normal <select>, but it wouldn't open as a normal <select> does,
which would be very confusing for the user.
--
| Grant Wagner <gw*****@agricoreunited.com>
* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html
* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp
* Netscape 6/7 DOM Reference available at:
*
http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
*
http://www.mozilla.org/docs/web-deve...upgrade_2.html