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.
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.