Streaming live at 10am (PST)

Change Form Redirect URL depending on option selected in form


I’m using a Webflow form to submit customer signup details to a Google Adwords agency. In this signup - the customer picks a monthly plan and a monthly spend. The form is submitted and the customer is redirected to an external subscription service where they submit their credit card details for payment.

The redirect to the external service needs to be dynamic - depending on their selection of plan and ad spend - it will redirect to a different subscription signup URL. I’ve been able to use javascript to change the form “redirect” url. However, even though the form redirect URL has been changed, it still redirects to the original form redirect URL i…e the redirect URL which was there when the page loaded. It seems that the redirect url which is specified on page load, is the URL which is used regardless of if it’s changed or not after page load.

Can anybody help with this or has anyone any other suggestions on how i can achieve this dynamic redirect?

I can change the form action dynamically using javascript so I was thinking about using an external form service and creating a separate form handler (i.e. a separate form action URL) for each option. However, this would mean making 20 separate form handlers so I’m slow to do this.

Any help or ideas would be greatly appreciated.

You’ll have to clear the Webflow form redirect field and custom code the redirect part.

Ok. Any idea how to custom code the redirect path?

This is the function you’ll need to use to detect the form submission

From there just piece together the URL and set window.location to the URL.

1 Like

Did anyone manage to create a working solution for this? :thinking:

Nope! Would be nice if someone could help with it…

This should work, add it to your page custom code. Replace the relevant ID’s and select box value(s).

	$('#Signup-Form').submit(function() {

		if ($('#plan').val() == 'plan-gold-package') {
		  setTimeout(function() {
		    location.href = '' + $('#plan').val();
		  }, 100);



Nice! Thanks for that

This custom code does not stop the consumption of the monthly Webflow form submission quota btw…

In this instance, I still wanted the form submission :slight_smile:

However, I did find an issue were the redirect would fire before the form submission was processed (which caused a form error but still redirected). So I increased the delay, which seems to have fixed the issue.

You can also use ajaxComplete, so you won’t have to rely on a fixed duration.

1 Like