Custom Routing

Use JavaScript to dynamically select your form's endpoint.

To use custom routing with a dropdown menu, follow these steps:
  1. Copy the code below into your form's HTML page
  2. Update the dropdown options, action values, and logic based on your endpoints
  3. 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>
    Please note:

    We can't possibly catch all the errors that you may have in your template. If the template throws an error, you will receive the submission email with our default template and a note that your template didn't work. If you need help with your template, feel free to contact us.