html - Rotating links when submit button is clicked -


i want know if there way have submit button in form redirect different links every time clicked depending on person selected. example: form have name, email, , how did hear drop down of numerous options , submit button. if person picked option 1 once submit button clicked redirect link 1. when person comes , pick option 1 redirect link 2. when person comes , pick option 1 again redirect link 1 , on. need possible options in drop down , email addresses recorded me see @ later time. possible? sorry new this.

you can this

html

<form action="./hi_friend.php" method="post"  id="countform"> <select name="sellist" id="sellist">   <option value="1">first</option>   <option value="2">second</option>   <option value="3">last</option> </select> <input type="submit" value="submit"> </form> 

js

$('#countform').submit(function(){   var $form = $("#countform");    if($("#sellist").val() == "1")     $form.action = "./first_result.php";   else if($("#sellist").val() == "2")     $form.action = "./second_result.php";   else if($("#sellist").val() == "3")     $form.action = "./last_result.php";    alert("submit " + $form.action);   return true; }); 

working fiddle


Comments

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -