PerfectForms Forums » Laying out a Form

limit selections within Checkbox Group

(2 posts)
  1. adjuvi
    Member

    I have a Checkbox Group of 10 fields (i.e. check all that apply), but would like to limit selection to a maximum of 6. I could do this with a state behavior, but don't seem to be able to "count" the number of boxes checked within the group.

    Posted 2 years ago #
  2. ijobling
    Member

    The way you mention is the best way..
    there are a number of ways you could do this depending on your selection.
    One way perhaps is that on each of the checkbox items 'changes field data' or 'when clicked' you could have a conditional script.. such that if that item 'is selected' it writes a value (1 perhaps) to a hidden field on the form, and then if it is 'not selected' (ie the FALSE from the branch) it writes another value (0 perhaps) to that field. then even if the user 'changes' their mind, the hidden field for that checkbox item contains 1 or 0

    and then you can 'count' these 10 hidden fields up and if they exceed your requirements, present a message to the user to resolve before letting them proceed to the rest of the form (this 'count' could be on the 'show next page' for instance)

    Posted 2 years ago #

RSS feed for this topic

Reply

You must log in or register to post.

Contact

1917 Palomar Oaks Way
Suite 160
Carlsbad, CA 92008
866.900.8588

  picture  picture  picture  picture