PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Multiple Check boxes - making all 3 mandatory

  1. Hi,
    Gravity 1.5.3 and WP 3.2.1
    http://beyondparalleldesign.com/devwpsite4/accommodation/rental-application/
    I have 3 check boxes in a Check box field that is Mandatory. (example at bottom of page 1) I want the user to have to check all 3 in order to pass validation. This is similar to a software license form where you tick to indicate that you agree and accept. However the user can get away with ticking only 1 box or unticking 2 boxes and it still passes vaildation. I tried both default check and no default check. Is this possible? Or do I have to make 3 sperate check box fields instead of 1 or is there something else I need to do? tx..e

    Posted 13 years ago on Wednesday November 9, 2011 | Permalink
  2. Your options are...

    - Implement custom jQuery to enforce validation and require all 3 checkboxes are checked.

    - Implement custom validation using the gform_validation hook to require all 3 checkboxes are checked.

    - Add 3 check box fields instead of 1 and make each required.

    It's going to depend on how simple you want to make it. The easiest solution is so use 3 checkbox fields instead of 1. But if you know PHP and how to use hooks/filters than writing some custom validation using the gform_validation hook shouldn't be too difficult and would allow you to use a single field.

    Posted 13 years ago on Wednesday November 9, 2011 | Permalink