JavaScript - Click disabled option to select other options?
Posted: Sun Jul 30, 2006 11:23 pm
feyd | Please use
My wild guess at the event handler...
With IDs needing to be unique I'm not sure how you would dynamically doing this without creating some sort of list for all the regions associated with each state. Kick ass idea though.
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Here is a multiple choice select form field. Let us say the user clicks on the state even though it's disabled.
It would make sense to have JavaScript highlight the associated regions of that state all at once when the user clicked on the state with say an onclick or onmousedown event trigger.
[syntax="html"] <select class="state" name="" multiple="multiple">
<option class="state" disabled="disabled" value="state">State 1</option>
<option class="region" value="#">Region</option>
<option class="region" value="#">Region</option>
<option class="region" selected="selected" value="#">Region</option>
<option class="region" value="#">Region</option>
<option class="region" value="#">Region</option>
<option class="region" value="#">Region</option>
<option class="state" disabled="disabled" value="state">State 2</option>
<option class="region" value="#">Region</option>
<option class="region" value="#">Region</option>
<option class="region" selected="selected" value="#">Region</option>
<option class="region" value="#">Region</option>
<option class="region" value="#">Region</option>
<option class="region" value="#">Region</option>
</select>Code: Select all
<option class="state" disabled="disabled" onmousedown="select(state1)" value="state">State 1</option>feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]