-1

I want the user to pick and option from a dropdown, and be redirected to a page based on their selection. Option 1 redirecting to Page 1, Option 2 redirecting to Page 2, etc.

When I try to look this up, I get results for how to redirect a user to a url no matter what they enter or select on the form. A form completion redirect.

So I am looking for an example of how to redirect based on selection from a dropdown with each selection having a different redirect.

1 Answers1

-1

You could try us JavaScript, something like the below code?

<form name="store" id="form" method="post" action="">
<select name="formID">
<option value="/stores/form1.php">6</option>
<option value="/stores/form2.php">10</option>
</select>                   
</form>


<script>
document.getElementById('form').formID.onchange = function() {
    var newaction = this.value;
    document.getElementById('form').action = newaction;
};

</script>

You can find more info here too.

Derek MC
  • 366
  • 2
  • 4
  • 25