Embedded Form submission & redirect URL based on form parameters

Yep I can, I actually just helped out another member of the forum with something similar.

What is the final URL format you are looking to redirect to? Also - do you have an example page with the form that I could see?

In hindsight - the serialize option works but it is admittedly a little messy. :grinning_face_with_smiling_eyes:

The $form argument of the onFormSubmit callback is a jQuery collection of the entire submitted HubSpot <form> element that is stored at the moment the form was submitted, and successfully validated.

That means you can dive into the collection and “cherry-pick” whatever field values you may want to use doing something like this:

var website = $form.find('input[name="website"]').val();

That would give you the isolated website field value in a separate variable you could then append to your redirect location as needed.

setTimeout( function() {
 window.location = "http://www.domain.com/simulate.php?url=" + encodeURIComponent( website );
}, 500 ); // Redirects to url with query string data from form fields after 1/2 second.

You could do this infinitely - however if you need to pass/map many fields to specific query string keys - I also have a solution for that which is a bit more elegant in nature.