How to do a form action as well as submit details on webflow forms

How to do a form action (which is an external URL) as well as capture the submit details on the form in webflow?

Short answer: code! You will need to perform the external submission through the use of JS. Useful links:

https://stackoverflow.com/questions/2276463/how-can-i-get-form-data-with-javascript-jquery
https://api.jquery.com/jquery.post/

Thanks Jeandcc

I used this -
β€œscript>
Webflow.push(function() {
$(β€˜form’).submit(function() {
setTimeout(function() {
location.href = β€˜https://redirecturl?name=’ + $(β€˜#name’).val() + β€˜&email=’ + $(β€˜#email’).val() + β€˜&phone=’ + $(β€˜#phone’).val() + β€˜&a1=’ + $(β€˜#a’).val();
}, 100);
});
});
”

in order to do the form submission as well as redirect with the url parameters. This removed dependency on action in my specific case.

1 Like

Hi! Do you know how I would use or change this code to make it dynamic depending on selections made in the form? Essentially the form has to submit and also Redirect to a unique URL depending on options selected in form. Theirs six different options. Any help would be super appreciated!!

Thanks for this, it should be helpful.