We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26182
    • 164 Posts
    Hi,

    I was wondering how to include checkboxes in eForm that are required ie if they are not checked the form will not send.

    Thanks,

    Sarah
      • 33372
      • 1,611 Posts
      I usually use JavaScript to disable the submit button unless the checkbox has been checked, and then if I really care a lot about being sure that it was checked I use an eForm event function to add an error to the required fields array (which keeps the form from being sent). You could probably add a specific validation rule to the eform tag in your form chunk (if the value is not whatever the checked value is set to, reject it). The one thing that I haven’t been able to get to work properly in eForm is having a checkbox checked by default but respect when a user unchecks it and has other validation errors...
        "Things are not what they appear to be; nor are they otherwise." - Buddha

        "Well, gee, Buddha - that wasn't very helpful..." - ZAP

        Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options