View Full Version : <select> menu onClick

01-18-2009, 10:01 PM
Yo, this is really really basic...

So I want a drop down menu which when you click the <option> row you want, it loads a page there and then (just like clicking a link) rather than having to press a form submit button.

I had something along the lines of this:

<select><option onClick="parent.location='cheese.html';">Cheese</option></select>

But that only works in Firefox... what can I doooo?

Thanks. =)

01-18-2009, 10:53 PM
How about this ...

<title>SBox Menu</title>
<h1>Select Menu</h1>
<select onchange="if(this.value!=''){document.location.href=this.value}">
<option value="">Select location</option>
<option value="http://www.codingforums.com">CodingForums</option>
<option value="http://www.webdeveloper.com">Webdeveloper</option>
<option value="http://www.javascript.com">JavaScript</option>

01-19-2009, 03:59 PM
Thanks for that, works fine. =)

01-19-2009, 11:00 PM
You're most welcome.
Glad I was able to help.
Good Luck!