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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form redirects on submit depending on values

Status
Not open for further replies.

wrmedia

Technical User
Jun 6, 2002
19
US
have the following options in a formmail

<form>

<input TYPE="checkbox" NAME="talkative" VALUE="4">Talkative<br><br></td>
<input TYPE="checkbox" NAME="forceful" VALUE="1">Forceful<br><br></td>
<input TYPE="checkbox" NAME="calm" VALUE="3">Calm<br><br></td>
<input TYPE="checkbox" NAME="careful" VALUE="2">Careful<br><br></td>

blah blah blah
</form>

would like to add some code where when the submit button is pressed to send the form the user is directed to one of 4 web pages depending on the value of those first four options

for example if has chosen calm with value 3 on submit the browser will redirect to 3.html

in fact I'd like a new window to pop up with 3.html

thanks
 
sure:
<head>
function Goto()
{
//Give the form a name.
if(document.FormName.talkative.checked==true)
{
document.FormName.action="1.html"
document.FormName.submit()
}
//repeat similarly for other checkboxes...
}
</head>
<input type="button" name="Submit" action="Goto()">

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top