Custom Routing
Use JavaScript to dynamically select your form's endpoint.
To use custom routing with a dropdown menu, follow these steps:
- Copy the code below into your form's HTML page
- Update the dropdown options, action values, and logic based on your endpoints
- Customize the rest of the form as needed
Note: The action value specified in the <form> tag will be the default starting endpoint
HTML
<form name="myForm" action="https://usebasin.com/f/j9jr01j29384" method="POST"> <label for="inquiry">Nature of Inquiry</label> <select id="inquiry" <select onchange="setAction(this)"> <option value="pricing">Pricing</option> <option value="careers">Careers</option> <option value="support">Support</option> </select> </form> <script> setAction = function(dropDown) { var action; switch(dropDown.value) { case "pricing": action = "https://usebasin.com/f/df98j193jfj"; break; case "careers": action = "https://usebasin.com/f/72a68a5ef18"; break; case "support": action = "https://usebasin.com/f/a2dfj92lc29"; break; } document.myForm.action = action; }; </script>