Jump to content

Option Field Redirection


ph34r007

Recommended Posts

Hey guys,

Is it possible to make an option field that when you pick an option it redirects you to a certain page, and if you pick another option it takes you to another? Im trying to make this for an ordering form. I tried looking on google but i couldnt find anything, and if my memory servers  me correctly ive been to a site that did this before.
Link to comment
https://forums.phpfreaks.com/topic/18658-option-field-redirection/
Share on other sites

Hi, I think this is what you want, just run the script and see if its what you want.

<script language = javascript>

function send(){

if (document.form1.options[0].checked){
window.location = "http://www.cy2online.net";
}
else{
window.location = "http://www.google.com";
}

}

</script>

<form name=form1>
<input type=radio name=options value="Cy2 Online.net">Cy2 Online.net
<input type=radio name=options value="google">Google
<br>
<input type="button" name="button1" value="Send" onclick="send()">
</form>

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.