...

View Full Version : <select> menu onClick



Common
01-18-2009, 09: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. =)

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


<html>
<head>
<title>SBox Menu</title>
</head>
<body>
<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>
</select>
</body>
</html>

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

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum