Last active
December 9, 2019 23:08
-
-
Save jillbert/9d3107d55ca2bb5249d08e899f3c6feb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.form_class').submit(function( event ) { | |
var form = $('<form></form>'); | |
form.attr("method", "post"); | |
form.attr("action", "test.com"); | |
var email = $( "#id_of_field_for_email" ).val(); | |
var first_name = $( "#id_of_field_for_first_name" ).val(); | |
form.append("<input type='hidden' name='email' value=" + email + "></input>"); | |
form.append("<input type='hidden' name='first_name' value=" + first_name + "></input>"); | |
var formData = $(form).serialize(); | |
// Make AJAX request | |
$.post("https://hooks.zapier.com/hooks/catch/1234567/abcd01e/", formData).complete(function() { | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment