[Javascript] dropdown and readonly

jsWalter jsWalter at torres.ws
Thu Oct 28 11:07:25 CDT 2004


> Hi!
>
> Interesting prbolem. How to change dropdown to readOnly propertie?

can't. By definition, SELECT is READONLY, since a user can't modify its
contents.


> If I change it to disabled then the form (dropdown) is not
> submited.

Right. By definition, DISABLED is not sent via FORM SUBMIT.

When I need to make a SELECT 'readonly' (as you say), I do it via JS and
then insert the value I want into a hidden INPUT with the same name.

When the SELECT is not 'readonly', then the HIDDEN is DISABLED so its
value (or lack there of) is not sent to the server.

Does that help?

Walter




More information about the Javascript mailing list