Skip to content

Instantly share code, notes, and snippets.

@ksnider
Created January 20, 2015 12:47
Show Gist options
  • Save ksnider/2a14849db1657e4e9926 to your computer and use it in GitHub Desktop.
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
<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