Created
January 20, 2015 12:47
-
-
Save ksnider/2a14849db1657e4e9926 to your computer and use it in GitHub Desktop.
This script pulls parameters, if any, from the query string, and automatically submits the Infusionsoft web form
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
<script> | |
$ = jQuery; | |
$(document).ready(function() { | |
var query, param, arg; | |
$('html').css('display', 'none'); | |
if (query = window.top.location.href.split('?')[1]) { | |
$.each(query.split('&'), function (idx, val) { | |
param = val.split('=')[0]; | |
arg = val.split('=')[1]; | |
if ( ! $('#' + param).length) { | |
return; | |
} | |
$('#' + param).val(arg); | |
}); | |
} | |
$('.infusion-form').first().submit(); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment