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.

Limiting the amount of checkboxes that can be checked that use conditional logic

  1. matsilva
    Member

    Basically just like the title says I want to limit the number of checkboxes that can be checked in a checkbox fieldset.

    I have read and implemented this:
    http://www.gravityhelp.com/forums/topic/limiting-the-amount-of-checkboxes-that-can-be-checked#post-6990

    Worked like a charm, however in my form when checking a box we have conditional logic to open a dropdown but when I try to tick another box like a normal user would probably so jQuery stops it from being checked but opens the conditional logic item that it applied to and continues to do so unless you uncheck your first choice and check another.

    Any help from the amazing Gravity Form team or forum members? Bonus points for code :-)

    Posted 11 years ago on Saturday June 9, 2012 | Permalink
  2. I'll ask around and see if anyone has any ideas for you.

    Posted 11 years ago on Monday June 11, 2012 | Permalink
  3. Hi Matsilva,

    The easiest way to get around this is going to be disabling the other checkboxes once the limit has been reached. Here is an alternate method for limiting checkboxes with Gravity Forms that does just that.

    http://gravitywiz.com/2012/06/11/limiting-how-many-checkboxes-can-be-checked/

    Posted 11 years ago on Monday June 11, 2012 | Permalink
  4. matsilva
    Member

    Awesome!. Thanks guys!

    Posted 11 years ago on Tuesday June 12, 2012 | Permalink
  5. matsilva
    Member

    After trying this out it didn't seem to work for me. Added the snippet to the functions file and changes the appropriate values but it just allows me to check all boxes still.

    Posted 11 years ago on Tuesday June 12, 2012 | Permalink
  6. Hi Matsilva,

    Can you provide a link to a form where you have this implemented?

    Posted 11 years ago on Tuesday June 12, 2012 | Permalink
  7. matsilva
    Member

    Yes. http://bit.ly/KOXzMf

    Posted 11 years ago on Tuesday June 12, 2012 | Permalink
  8. andrewharbert
    Member

    Hello,

    I am looking to do the same thing and I tried adding the code to the functions file and it throws an error. I am using iThemes Builder and the Default Child Theme.

    Any help?

    Link to test page - http://www.aaronchang.com/contest/

    Thanks.

    Posted 11 years ago on Friday December 21, 2012 | Permalink
  9. What is the error it's throwing?

    If it's a syntax error, you likely pasted it into the file incorrectly or in the wrong place. If it's another error, we need to know the exact error.

    Posted 11 years ago on Saturday December 22, 2012 | Permalink
  10. andrewharbert
    Member

    Hello,

    Fatal error: Cannot redeclare class GFLimitCheckboxes in /home/content/20/8052220/html/contest/wp-content/themes/Builder/custom-functions.php on line 8

    I pasted into the functions.php file in the themes/Builder folder.

    Posted 11 years ago on Saturday December 22, 2012 | Permalink
  11. andrewharbert
    Member

    Hello,

    I found this issue. with iThemes, I needed to paste it into the functions.php file in the Child theme that I am using.

    Thanks.

    Cheers,

    Andrew

    Posted 11 years ago on Saturday December 22, 2012 | Permalink
  12. Thank you for that update.

    Posted 11 years ago on Saturday December 22, 2012 | Permalink

This topic has been resolved and has been closed to new replies.