Forum Moderators: open

Message Too Old, No Replies

How to make certain values return false in drop down menu?

help please..

         

dreamcatcher

9:46 am on Aug 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have this drop down box code that directs people once they select something:


<select name="options" onChange="location=this.options[this.selectedIndex].value">
<option selected value="0">Please Select...</option>
<option value="0">----------------------</option>
<option value="index.php">Homepage</option>
<option value="admin.php">Admin Area</option>
<option value="contact.php">Contact Us</option>
</select>

If someone selects 'Homepage' then that becomes the selected value and so on.

So my question is, how do I change the code so that if someone selects something with a 0 value on another page it returns false?

Thank you!

Gul_Dukat

7:53 pm on Aug 15, 2004 (gmt 0)

10+ Year Member



Hi,

try so


<select name="options" onChange="if(this.value!= 0){location=this.options[this.selectedIndex].value}">


;-)

dreamcatcher

10:23 pm on Aug 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Works like a charm, thank you very much. :)