Skip to content

Instantly share code, notes, and snippets.

@longjasonm
Created November 12, 2013 17:56
Show Gist options
  • Save longjasonm/7435533 to your computer and use it in GitHub Desktop.
Save longjasonm/7435533 to your computer and use it in GitHub Desktop.
Validate a Marketo Terms and Conditions (or any other) Checkbox
//Add the ID of your Marketo Form
$('#mktForm_1030').attr('onSubmit','return validate_form ( );');
//Add the "name" properties of your form and field. i.e. mktForm_1030, CustomField_Terms_of_Service)
function validate_form ( )
{
valid = true;
if ( document.mktForm_1030.CustomField_Terms_of_Service.checked == false )
{
alert ( "Please check the Terms & Conditions box." );
valid = false;
}
return valid;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment