This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Possible to edit checkbox settings


  1. mculpepper
    Member

    Right now, if you add a group of checkboxes and mark as required, it's valid if any of the checkboxes are checked.

    I'd like to add another setting to require EVERY checkbox to be selected, as this is very common - e.g., I am over 13, I agree to terms

    Since the JavaScript files are encrypted, is it possible to add this functionality?

    Posted 15 years ago #
  2. yuniar

    I'm afraid this one won't be quite simple to do.
    In this case, I suggest to create 1 checkbox with 1 option and set it as required.

    Then duplicate the checkbox as many as you need. This way, you will have a group of checkboxes and all are marked as required.


    MachForm Founder

    Posted 15 years ago #
  3. mculpepper
    Member

    I see the validation for checkboxes on line 570 of post-functions.php - however, I'm not sure how to make a rule that says each checkbox is required. Can you give insight?

    I can not use your solution, as all checkboxes would all have duplicate labels and really dirty up the form.

    Posted 15 years ago #
  4. yuniar

    Actually, you can simply remove the label for the other checkboxes. Only the first checkbox need the label.

    You can see a demo form I created here:
    http://www.appnitro.com/forms/view.php?id=32

    Try it and you'll see that all checkboxes are required.
    For the above form, I needed to add this CSS code too:

    #li_2 label.description, #li_3 label.description, #li_4 label.description
    {
      display: none;
    }

    This is necessary to hide the red star character(to mark required fields) from the other checkboxes.


    MachForm Founder

    Posted 15 years ago #

RSS feed for this topic

Reply