Title: Validation issue when checking checkbox fields
Last modified: August 9, 2022

---

# Validation issue when checking checkbox fields

 *  [lippiun](https://wordpress.org/support/users/lippiun/)
 * (@lippiun)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/validation-issue-when-checking-checkbox-fields/)
 * Hello,
 * I am using Contact Form 7 v5.6.1 on my local WP 6.0.1 installation with the default
   Twenty Twenty Two theme.
 * I have noticed a bug when using checkbox fields on a contact form. The issue 
   is when i toggle the checkbox on the frontend, it triggers a change event on 
   the form causing all validation errors to appear.
 * This is not expected behaviour and the validation should only be triggered when
   a user has submitted the form.
 * If i remove the ‘change’ event handler from the WPCF form DOM element, it works
   as expected.
 * I’ve have captured a screen recording of the issue to help with your investigations.
 * [https://www.awesomescreenshot.com/video/10411987?key=e7b6af3dec2fce4a13f39454bbf51d60](https://www.awesomescreenshot.com/video/10411987?key=e7b6af3dec2fce4a13f39454bbf51d60)
    -  This topic was modified 3 years, 10 months ago by [lippiun](https://wordpress.org/support/users/lippiun/).

Viewing 15 replies - 1 through 15 (of 24 total)

1 [2](https://wordpress.org/support/topic/validation-issue-when-checking-checkbox-fields/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/validation-issue-when-checking-checkbox-fields/page/2/?output_format=md)

 *  Thread Starter [lippiun](https://wordpress.org/support/users/lippiun/)
 * (@lippiun)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/validation-issue-when-checking-checkbox-fields/#post-15903495)
 * Hi, any update on the above?
 *  [Gal Baras](https://wordpress.org/support/users/galbaras/)
 * (@galbaras)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/validation-issue-when-checking-checkbox-fields/#post-15909692)
 * It’s quite impossible to assist directly with a local server. You may have some
   other event handler involved, for example, but you’ll have to find it yourself
   or publish the site somewhere and share the public link.
 *  Thread Starter [lippiun](https://wordpress.org/support/users/lippiun/)
 * (@lippiun)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/validation-issue-when-checking-checkbox-fields/#post-15910390)
 * Hi Gal,
 * You can see the site [here](http://realbrandingtesting.co.uk/atsolutionsuk/trade-accounts/register-for-a-trade-account/)
 *  [Gal Baras](https://wordpress.org/support/users/galbaras/)
 * (@galbaras)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/validation-issue-when-checking-checkbox-fields/#post-15914582)
 * In your theme’s main.js, there’s a copy of [https://fellowtuts.com/wordpress/contact-form-7-radio-checkbox-bootstrap-4-style/](https://fellowtuts.com/wordpress/contact-form-7-radio-checkbox-bootstrap-4-style/),
   which could be the culprit.
 *  Thread Starter [lippiun](https://wordpress.org/support/users/lippiun/)
 * (@lippiun)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/validation-issue-when-checking-checkbox-fields/#post-15920401)
 * Hi,
 * The bootstrap styling script isn’t the problem as the issue still persists after
   removing it.
 * Even when i deactivate ALL plugins and switch to the default Twenty Twenty Two
   theme, the form is still validating after checking a checkbox. I can see the 
   event handler for this is coming from your plugin.
 *  Thread Starter [lippiun](https://wordpress.org/support/users/lippiun/)
 * (@lippiun)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/validation-issue-when-checking-checkbox-fields/#post-15920427)
 * You can replicate this issue by creating a fresh WP install on the following 
   environment:
 * WordPress v6.0.1
    Web Server: nginx PHP Version: 7.4.1
 * Theme: Twenty Twenty Two
 * Contact Form 7 Version: 5.6.2
 * Then create a basic form with the following the fields:
 *     ```
       <label> Your name
           [text* your-name] </label>
   
       <label> Your email
           [email* your-email] </label>
   
       <label> Subject
           [text* your-subject] </label>
   
       [checkbox checkbox-340 use_label_element "Test"]
   
       <label> Your message (optional)
           [textarea your-message] </label>
   
       [submit "Submit"]
       ```
   
 * Then, when you click on the checkbox you will the form validations appear.
 *  [Gal Baras](https://wordpress.org/support/users/galbaras/)
 * (@galbaras)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/validation-issue-when-checking-checkbox-fields/#post-15920501)
 * Time for [@takayukister](https://wordpress.org/support/users/takayukister/) to
   get involved, I guess.
 *  Thread Starter [lippiun](https://wordpress.org/support/users/lippiun/)
 * (@lippiun)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/validation-issue-when-checking-checkbox-fields/#post-15937767)
 * Hi,
 * Any update on this?
 *  [Gal Baras](https://wordpress.org/support/users/galbaras/)
 * (@galbaras)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/validation-issue-when-checking-checkbox-fields/#post-15937934)
 * I’ve tested it on one of my sites and the problem happens there too, so this 
   is an issue with the plugin. I’ve even isolated it to the “change” event handler
   form.wpcf7-form.init in includes/js/index.js.
 * Unfortunately, that’s as far as I go.
 * [Try opening an issue for this on Github](https://github.com/takayukister/contact-form-7/issues/new/choose).
 *  [andreaciocca](https://wordpress.org/support/users/andreaciocca/)
 * (@andreaciocca)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/validation-issue-when-checking-checkbox-fields/#post-15986453)
 * Hi,
    any news on this?
 * I tried to open an issue request on github which has been categorized as invalid
   and consequently removed (you can find original post screenshot here [https://ibb.co/NKBdwRT](https://ibb.co/NKBdwRT))
 * I wonder where I should ask for this then 🙂
 *  Thread Starter [lippiun](https://wordpress.org/support/users/lippiun/)
 * (@lippiun)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/validation-issue-when-checking-checkbox-fields/#post-15986467)
 * Pretty crazy how I posted about this 4 weeks and the plugin developer still hasn’t
   answered. Yet he’s been answering newer questions…
 * Be great to get an idea of when this will be fixed as it’s a bad customer experience
   at the moment.
 *  [andreaciocca](https://wordpress.org/support/users/andreaciocca/)
 * (@andreaciocca)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/validation-issue-when-checking-checkbox-fields/#post-15987083)
 * [@lippiun](https://wordpress.org/support/users/lippiun/) did you manage to solve
   this bug temporarily?
 * > If i remove the ‘change’ event handler from the WPCF form DOM element, it works
   > as expected.
 * Could you explain please where could I do this?
 *  Thread Starter [lippiun](https://wordpress.org/support/users/lippiun/)
 * (@lippiun)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/validation-issue-when-checking-checkbox-fields/#post-15987746)
 * I could only[remove event listeners](https://devtoolstips.org/tips/en/disable-event-listeners/)
   via the Chrome Developer Tools. I tried adding some custom code to remove it 
   permanently but had no luck. I think this needs to be removed from the core index.
   js file
 *  [Gal Baras](https://wordpress.org/support/users/galbaras/)
 * (@galbaras)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/validation-issue-when-checking-checkbox-fields/#post-15989327)
 * [@lippiun](https://wordpress.org/support/users/lippiun/) Maybe you shouldn’t 
   have mentioned my name 😀
 *  [andreaciocca](https://wordpress.org/support/users/andreaciocca/)
 * (@andreaciocca)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/validation-issue-when-checking-checkbox-fields/#post-15990067)
 * To point it out, I mentioned it, cause I thought you were an official supporter.
   My bad

Viewing 15 replies - 1 through 15 (of 24 total)

1 [2](https://wordpress.org/support/topic/validation-issue-when-checking-checkbox-fields/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/validation-issue-when-checking-checkbox-fields/page/2/?output_format=md)

The topic ‘Validation issue when checking checkbox fields’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

## Tags

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

 * 24 replies
 * 4 participants
 * Last reply from: [Gal Baras](https://wordpress.org/support/users/galbaras/)
 * Last activity: [3 years, 7 months ago](https://wordpress.org/support/topic/validation-issue-when-checking-checkbox-fields/page/2/#post-16120474)
 * Status: not a support question