Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Value List Action

Status
Not open for further replies.

bopritchard

Programmer
Jan 27, 2003
199
0
0
US
I have a dropdown list of 3 values...when the 2nd item is selected i want to go to another page...but on the other two items..i want it to simply select them...nothing else...tried using the jumpmenu event but it seemed to want to fire some event for every selection...

ideas?
thanks
 
Hi,

Just made you an example which does the trick.
You still need to fill in the action for the from and add a submitbutton in case value1 or value3 are selected.
Code:
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<script language=&quot;JavaScript&quot;>
<!--
function redirect()
{
if (document.myForm.test.options[document.myForm.test.selectedIndex].value   == &quot;b&quot;)
{
window.location.href=&quot;[URL unfurl="true"]http://www.tek-tips.com&quot;;[/URL]
}
}

-->
</script>
</head>

<body>
<form name=&quot;myForm&quot; action=&quot;whatever&quot; method=&quot;post&quot;>
<select name=&quot;test&quot; onChange=&quot;Javascript: redirect();&quot;>
<option value=&quot;a&quot;>value1</option>
<option value=&quot;b&quot;>value2</option>
<option  value=&quot;c&quot;>value3</option>
</select>
</form>
</body>
</html>

Regards, goaganesha
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top