1. Startseite
  2. Wissensdatenbank
  3. Tipps, Tricks und Anpassungen
  4. Tipps und Tricks
  5. Automatisches Prüfen eines benutzerdefinierten Feldes Checkbox

Automatisches Prüfen eines benutzerdefinierten Feldes 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.

War dieser Artikel hilfreich?

Verwandte Artikel

Sie können die gesuchte Antwort nicht finden?

Wenden Sie sich an unser Customer Success Team
Kontaktieren Sie uns!