Title: checkbox toggle not working
Last modified: November 19, 2016

---

# checkbox toggle not working

 *  Resolved [IT Hertz](https://wordpress.org/support/users/it-hertz/)
 * (@it-hertz)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/checkbox-toggle-not-working/)
 * I’m trying to toggle show/hide one group while showing/hiding a second group 
   when the user checks and unchecks a terms and conditions checkbox. Unfortunately,
   the plugin doesn’t work at all with [acceptance] tags.
 * I want it to hide the terms and show the submit button when the user checks the
   box — ergo, when they agree to the terms, they are then allowed to submit the
   form (upload), if they unagree, the terms show again and the submit button disappears.
 * The plugin toggles the submit button group properly, but only when that’s the
   only element I have set conditions for. It doesn’t work at all with the terms
   group and the submit button group is hidden and won’t toggle when I add conditions
   for the terms group.
 * I’ve tried everything I could think of, including trying to fool the plugin into
   thinking plaintext was a legit CF7 tag by using [text text-1], and <label> to
   see if that mattered.
 * Also, the conditions for the submit button group get corrupted and won’t work
   sometimes when I try to add conditions for the terms group, and I have to remove
   all conditions and even at times delete the entire form and paste the original(
   same) form block back into CF7’s form tab.
 * tldr;
    It doesn’t work with more than one group, at least when a checkbox is 
   the trigger. And it would be nice if it would work with plaintext — it doesn’t,
   even if the text is the only group.
    -  This topic was modified 9 years, 6 months ago by [IT Hertz](https://wordpress.org/support/users/it-hertz/).

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [IT Hertz](https://wordpress.org/support/users/it-hertz/)
 * (@it-hertz)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/checkbox-toggle-not-working/#post-8457730)
 * Well, for some reason it is working with plain text now, but the problem remains
   that setting more than ONE condition breaks the plugin and none of the conditions
   work.
 *  Thread Starter [IT Hertz](https://wordpress.org/support/users/it-hertz/)
 * (@it-hertz)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/checkbox-toggle-not-working/#post-8457752)
 * To clarify, two **opposing toggle states** can’t be set as conditions.
    If I 
   set both conditions to SHOW upon checking the checkbox, the toggle works, it 
   shows/hides both groups with check/uncheck. However, if I set the submit button
   group to show and the terms group to hide upon checking the checkbox, it either
   breaks and both groups stay hidden (sometimes) or only the submit button toggle
   works. I also tried `not equals` on the terms group to try to show terms when
   the checkbox is unchecked, but terms is never shown in this case.
 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/checkbox-toggle-not-working/#post-8458174)
 * Could you please paste the form code and conditions that aren’t working. There’s
   less chance I misunderstand your question that way and it would be a great help
   if I can just paste the code and test it. Thanks
 *  Thread Starter [IT Hertz](https://wordpress.org/support/users/it-hertz/)
 * (@it-hertz)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/checkbox-toggle-not-working/#post-8458405)
 * Hello, they are as follows:
 * Form:
 *     ```
       [group terms]<b><span style="color:#000; background-color:#ffcc00;">Uploading is disabled until you agree to our terms:</span></b>
       Terms & conditions go here.[/group]
       [checkbox checkbox-1 "I agree to the above terms"]
       [group submit]<b><span style="font-family:Verdana; color:#fff; background-color:#006000;">Thank you. &nbsp;You may now</span> </b> [submit class:search-button "Upload"][/group]
       ```
   
 * Exported rules:
 *     ```
       if [checkbox-1] equals "I agree to the above terms" then show [submit]
       if [checkbox-1] equals "I agree to the above terms" then hide [terms]
       ```
   
 * I also tried:
 *     ```
       if [checkbox-1] equals "I agree to the above terms" then show [submit]
       if [checkbox-1] not equals "I agree to the above terms" then show [terms]
       ```
   
 * and:
 *     ```
       if [checkbox-1] equals "I agree to the above terms" then show [submit]
       if [checkbox-1] not equals "I agree to the above terms" then show [terms]
       if [checkbox-1] equals "I agree to the above terms" then hide [terms]
       ```
   
 * For the terms, I also tried (not all at once):
 *     ```
       if [checkbox-1] equals "" then show [terms] (i.e., I left the value field empty)
       if [checkbox-1] equals null then show [terms]
       if [checkbox-1] equals $null then show [terms]
       ```
   
 * The plugin evidently doesn’t parse null strings/parameters. Looking at your php,
   perhaps adding an `is_null` in the `if (is_array($conditions)) {` block would
   parse and toggle on such nulls? Or maybe you could check state via jQuery?
    -  This reply was modified 9 years, 6 months ago by [IT Hertz](https://wordpress.org/support/users/it-hertz/).
    -  This reply was modified 9 years, 6 months ago by [IT Hertz](https://wordpress.org/support/users/it-hertz/).
 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/checkbox-toggle-not-working/#post-8698398)
 * sorry for the late reply.
 * I guess `if [checkbox-1] not equals "I agree to the above terms" then show [terms]`
   would do the trick.
 * I’m cleaning out this forum a bit. If you still have this problem, please create
   a new support thread and link to this one.
    -  This reply was modified 9 years, 3 months ago by [Jules Colle](https://wordpress.org/support/users/jules-colle/).

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘checkbox toggle not working’ is closed to new replies.

 * ![](https://ps.w.org/cf7-conditional-fields/assets/icon-256x256.png?rev=2072595)
 * [Conditional Fields for Contact Form 7](https://wordpress.org/plugins/cf7-conditional-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cf7-conditional-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cf7-conditional-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/cf7-conditional-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cf7-conditional-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cf7-conditional-fields/reviews/)

## Tags

 * [toggle](https://wordpress.org/support/topic-tag/toggle/)

 * 5 replies
 * 2 participants
 * Last reply from: [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/checkbox-toggle-not-working/#post-8698398)
 * Status: resolved