Value isn't readonly, and you might not have an index but a string.
I'm not asking help how to code. I'd like to know what happenns in case 'VALUE' is set .


Master Br <[EMAIL PROTECTED]> escreveu:

João:
I think that the correct approach is to define the SELECTED INDEX of the list, never to try setting the list value directly. Indeed, I think that the value property is READ-ONLY in this case... so you can NOT set

Right approach:
objectSelect.selectedIndex = DESIRED_INDEX;


Joao Eiras escreveu:


Currently, no DOM specification explicitly defines behaviour and restrictions when setting the value of the value property for elements part of forms, like select, option, and input. That's however, work that's being done at WHATWG.
Yet, one single case persists:
- the value property of a HMTLSelectElement is a limited domain, formed by the value of the select's child option elements value property.

Is this a valid assertion ?
What is expected to happen when a script tries to set the value of the value property of a select element, value which doesn't exist among it's children ? Should the value remain unchanged ? An error thrown ?

thank you.






Reply via email to