PDA

View Full Version : How to do this



vasu
03-04-2009, 03:01 PM
Hi,

I am trying to design a drop down menu list for my website. I want to set an action that when someone select the product from dropdown list the browser should redirect the user to that page without pushing any GO button beside the dropdown menu. I have my links ready. I know html but what about javascript.
I designed html but i dont know how to redirect.

<select name="category">
<option value="www.yahoo.com">Liz claiborne</option>
<option value="www.google.com">Curve</option>
<option value="link3">ck</option>
<option value="link4>">Liz</option>
</select>

what next.

Thanks in advance

Master_script_maker
03-04-2009, 04:04 PM
Here you go: http://dynamicdrive.com/forums/showthread.php?t=38712

magicyte
03-05-2009, 03:50 AM
Use the onchange event in your menu. Here's some code:


<select name="category" onchange="location.href = this.options[this.selectedIndex].value;">
<option value="www.yahoo.com">Liz claiborne</option>
<option value="www.google.com">Curve</option>
<option value="link3">ck</option>
<option value="link4>">Liz</option>
</select>

Just use the onchange event handler and copy and paste it onto other menus if they have the same characteristics. Questions?