Limit Checkbox Selections Across Multiple Checkbox Fields

Home Forums Quform WordPress Limit Checkbox Selections Across Multiple Checkbox Fields

This topic is: not resolved
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #35451
    colourcraft
    Participant

    I want to style a number of checkboxes so that a maximum of 8 checkboxes can be selected, but need the checkboxes to have sub-headers separating some of them for styling purposes. It is for a swatch selection form, so as an example we would have is below… (The small ‘x’ representing the checkbox symbol)

    ~~~ Blue Colours~~~
    x Kingfisher Blue
    x Baby Blue
    x China Blue
    x Vintage Blue

    ~~~Green Colours~~~
    x Forest Green
    x Racing Green
    x Vintage Green

    I can’t see an easy way of having dividers in between certain checkbox break points when using just one single field, so I presume, unless it is possible, that the only way would be to have separate checkbox fields for each of the colour groups, with the sub-headers as html fields to separate them.

    I can see that you have some example code to limit the number of checkbox selections for a specific field ID, but is there a way, for example, to restrict the maximum number of checkbox selections to, say, 8 selections spread across 5 different checkbox ID’s

    If the example code could be supplied to do this, or if there is a way to introduce html code to break up checkboxes with sub header styling within a single checkbox ID, that would be fantastic.

    #35459
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #35462
    colourcraft
    Participant

    I’ve tried this, but think it would be easier styling wise to just do the calculation check across multiple check box fields, just for ease of editing in future from our end. So if its possible, it would be great to see the code to count selected items across multiple checkbox field s to only allow a maximum of 8 entries (as an example)…

    #35465
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #35607
    colourcraft
    Participant

    Thank you for this code, it works well.

    One final request, these fields are on page 1 of our form. Is there a way to add some javascript so that when the customer clicks on the submit button, it also checks all these fields as a group to make sure that at least 1 checkbox within the group of fields has been selected before continuing.

    • This reply was modified 10 months, 1 week ago by colourcraft.
    #35612
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy