fbpx

Automatically Check Custom Field Checkbox

There may be times when you want a form checkbox to start out in the checked state.  You can accomplish this by pasting this script snippet at the top of the page containing the form. You'll want to make sure you are in the Text tab in the page editor.

In the below code snippet you'll replace the # sign with the ID of the custom field. For example, if the ID of the custom field is 2, then you would use name='mm_custom_field_2′

<script>

jQuery(function(){


// repeat the follow 2 lines for each checkbox you want to check off

jQuery("input[type='checkbox'][name='mm_custom_field_#']").prop("checked", true);

jQuery("input[type='checkbox'][name='mm_custom_field_#']").trigger("change");


});

</script>

Please note that if you are using this checkbox as a confirmation of Terms of Service or something similar, using this option to bypass the user's need to check the box manually may not meet legal requirements for consent.

Was this article helpful?

Related Articles

Can’t find the answer you’re looking for?

Reach out to our Customer Success Team
Contact us!