Redirecting form submissions to two separate landing pages

Hi there, have a question on form capabilities that I’m hoping to get some support on.

We’re hoping to split users who complete our Request Demo form at Blueboard.com to two different submission/redirect landing pages, based on the values they input into our Company Size form field. For users who identify with less than 200 employees, they would go to landing page A, for those who identify with 201+ employees, they would go to landing page B. I haven’t seen the capability to split traffic from forms to different redirects, is this technically possible?

If anyone has successfully done this through a custom HTML edit, please share!

Thank you!
Morgan

Hey @morganc84 what you would need to do is use some custom code. For a high level overview you will need to:

1.) Make your form button have an onClick attribute that calls a javascript function
2.) Create this javascript function. You will need to make it capture the form inputs and check the company size input value
3.) Then, use javascript to redirect the user depending on what the value of the company size input was

Thanks @justin_c! Have you done this before, with any code snippets you’d be willing to share for guidance? Otherwise, I can chat with our Dev team to get their thoughts. Thanks so much in advance!

  • Morgan

If anyone looking for this, here you go. User can be redirected based on dropdown choice selection:

<script>
Webflow.push(function(){
$("#form-id").submit(function(){
	doc = document.getElementById("field-id").value;
	if (doc == 'choice-1') {
        setTimeout(function() {
            location.href = 'link-1';
        }, 100);
		}
    else{
    	setTimeout(function() {
            location.href = 'link-2';
        }, 100);
    }

	})});
</script>