readOnly attribute doesn't work for drop down list?

M

Matt

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!!
 
H

Hywel

Matt said:
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;

Considering that you can't change the content of a drop-down list
(without using scripting) is there any point in making it read only?
After all, it already is.
 
D

DU

Matt said:
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!!

I don't see any readonly attribute in the list of valid attributes for
select:
http://www.w3.org/TR/html401/interact/forms.html#edef-SELECT

DU
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top