Created
May 16, 2017 14:38
-
-
Save RobertCalise/eceb977d826c1167cebc5f5adc359188 to your computer and use it in GitHub Desktop.
Inject a required "I agree to the Terms" checkbox into an 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 type="text/javascript"> | |
var terms_name = 'Terms & Conditions', | |
terms_link = 'https://yourwebsite.com/link/to/terms'; | |
jQuery(document).ready(function() { | |
jQuery('.infusion-submit').before('<div style="margin-bottom: 5px;"><input id="inf_option_IagreetotheTermsConditions" name="inf_option_IagreetotheTermsConditions" style="margin-right:3px;" type="checkbox" value="232" /><label for="inf_option_IagreetotheTermsConditions">I agree to the <a href="'+terms_link+'" target="_blank">'+terms_name+'</a></label></div>'); | |
jQuery('.infusion-form').on('submit', function(e) { | |
if(!jQuery('#inf_option_IagreetotheTermsConditions').is(':checked')) { | |
e.preventDefault(); | |
alert('You must agree to the ' + terms_name + ' before submitting this form!'); | |
return false; | |
} | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment