rishid
05-05-2006, 03:04 PM
Hi
Trying to do some javascript this re/dis enables a button depending on what is selected in a multiple select box. I know selectedIndex only retusn the first value that is selected which is fine, but this keeps giving me a JS error.
This first click, gives an error but the next click it pops up an alert.
This seems like so broken.. if i mouseclick and hold and get a couple items it sometimes gives the result of the last selectionion of the box.
Whats up with this?
Thanks
<select size="8" id="availableOptions" name="availableOptions" multiple style="width:150px" onclick="alert(this.options[this.selectedIndex].value)">
<option value="blah">more stuff</option>
</select>
Trying to do some javascript this re/dis enables a button depending on what is selected in a multiple select box. I know selectedIndex only retusn the first value that is selected which is fine, but this keeps giving me a JS error.
This first click, gives an error but the next click it pops up an alert.
This seems like so broken.. if i mouseclick and hold and get a couple items it sometimes gives the result of the last selectionion of the box.
Whats up with this?
Thanks
<select size="8" id="availableOptions" name="availableOptions" multiple style="width:150px" onclick="alert(this.options[this.selectedIndex].value)">
<option value="blah">more stuff</option>
</select>