Kervtuza Posted June 28, 2012 Report Posted June 28, 2012 Hey guys, I'm trying to make a selection menu that when a selection is made, will redirect to another page, and each option acts as a link. Would anyone be able to explain the easiest way to do so or point me in the right direction?
falkencreative Posted June 28, 2012 Report Posted June 28, 2012 This has an explanation: http://www.w3schools.com/js/tryit.asp?filename=tryjs_selectmenu or you can do a Google search for "select menu" and you should come up with some resources.
khanahk Posted August 3, 2012 Report Posted August 3, 2012 Hey guys, I'm trying to make a selection menu that when a selection is made, will redirect to another page, and each option acts as a link. Would anyone be able to explain the easiest way to do so or point me in the right direction? Javascript would be a right direction for that. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Select a site</title> </head> <body> <script language="javascript"> function func() { var i = document.myform.myselect.selectedIndex; var site = document.myform.myselect.options[i].value; window.location.assign(site); } </script> <form name="myform"> <select name="myselect"> <option value="http://www.somesite.com">somesite.com</option> <option value="http://www.anothersite.com">anothersite.com</option> </select> <input type="button" value="go to the selected site" onclick="func();" /> </form> </body> </html> I believe that should do it. You can tweak it to your preference
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now