Select routing by name?

D

Don Lancaster

If I have a select box such as...

<select name="pickMS" size="1" multiple
onchange="pickMagicSinewave (form) ; " >
<option selected value="XXXX">Select your Magic Sinewave here.</option>
<option value="BEF7">Best Efficiency -- 7 pulses per quadrant</option>
<option value="DF7">Delta Friendly -- 7 pulses per quadrant</option>
<option value="BBE7">Bridged Best Efficiency -- 7 pulses per
quadrant</option>

numeric positions are typically used to route to selected functions...

if ( form.pickMS[1].selected) { setupBeff7 (this.form) } ;
if ( form.pickMS[2].selected) { setupDelf7 (this.form) } ;
if ( form.pickMS[3].selected) { setupBrbe7 (this.form) } ;


This creates problems later when adding or removing features.
How can I key on the value field rather than the numeric position?

if ( form.pickMS["BBE7"].selected) { setupBrbe7 (this.form) } ;

does not seem to work.

--
Many thanks,

Don Lancaster voice phone: (928)428-4073
Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml email: (e-mail address removed)

Please visit my GURU's LAIR web site at http://www.tinaja.com
 
S

scripts.contact

If I have a select box such as...
... onchange="pickMagicSinewave (form) ;

Why you are passing form ??
How can I key on the value field rather than the numeric position?
if ( form.pickMS["BBE7"].selected) { setupBrbe7 (this.form) } ;

sel=form.pickMS
if(sel.options[sel.selectedIndex].value=="BBE7")
//"do something"//
 

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,780
Messages
2,569,611
Members
45,265
Latest member
TodLarocca

Latest Threads

Top