Jump to content

form jump menu help


spires

Recommended Posts

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>

Link to comment
https://forums.phpfreaks.com/topic/142607-form-jump-menu-help/
Share on other sites

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>

Link to comment
https://forums.phpfreaks.com/topic/142607-form-jump-menu-help/#findComment-747835
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.