Created
November 2, 2011 21:46
-
-
Save bitneek/1335023 to your computer and use it in GitHub Desktop.
How to add Unbounce form parameters to a URL
This file contains 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
<script> | |
jQuery(document).ready(function() { | |
var processingSubmit = false; | |
var submitButton = jQuery('#'+window.module.lp.form.data.formButtonId); | |
var submitAction = submitButton.data('events').click[0]; | |
var baseURL = window.module.lp.form.data.confirmData; | |
submitButton.unbind('click', submitAction); | |
submitButton.click(function(e) { | |
if (processingSubmit) { | |
return; | |
} | |
processingSubmit = true; | |
window.module.lp.form.data.confirmData = baseURL + '?' + jQuery.param(jQuery.map(jQuery('form').serializeArray(), | |
function(param) { | |
return (param.name === 'pageId' || param.name === 'pageVariant') ? | |
null : | |
param; | |
})); | |
submitAction.handler(e); | |
processingSubmit = false; | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment