spires Posted January 27, 2009 Share Posted January 27, 2009 Hi guys. I'm trying to get a drop down menu to refresh the page when one of the options is selected. But I can't seem to get it to work. Could someone please advise on what to do? Dropdown online: http://www.businessmobiles.com/view_test.php <html> <head> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } //--> </script> </head> <body> <select name="user" onChange="this.form.submit()"> <option value="1" selected="selected">1</option> <option value="2">2</option> <option value="3">3</option> </select> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/142607-form-jump-menu-help/ Share on other sites More sharing options...
bobleny Posted January 27, 2009 Share Posted January 27, 2009 Maybe I'm a little off the beaten path, but this should work: <html> <head> <script language="JavaScript" type="text/JavaScript"> <!-- function Reload(value) { if(document.getElementById('user').value == "1") { window.location = "http://www.firemelt.net"; } if(document.getElementById('user').value == "2") { window.location = "http://www.google.com"; } if(document.getElementById('user').value == "3") { window.location = "http://www.cnn.com"; } } //--> </script> </head> <body> <select id="user" onChange="Reload()"> <option selected="selected">-- Select an Option --</option> <option>1</option> <option>2</option> <option>3</option> </select> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/142607-form-jump-menu-help/#findComment-747835 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.