Title: Validation in forms does not work
Last modified: June 20, 2023

---

# Validation in forms does not work

 *  Resolved [leokoltm](https://wordpress.org/support/users/leokoltm/)
 * (@leokoltm)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/validation-in-forms-does-not-work/)
 * Good afternoon. Validation in forms does not work for me – the form is sent regardless
   of whether the fields are filled in or not. At the same time, everything works
   on your test site – [http://conditional-fields-cf7.bdwm.be/form-tester/?hash=defcaddc4adf8a1103f7d89fa2fe5a82](http://conditional-fields-cf7.bdwm.be/form-tester/?hash=defcaddc4adf8a1103f7d89fa2fe5a82).
 * My form is called in its own popup window. You can check the work here – [https://spotipro.ru/#products](https://spotipro.ru/#products).
 * I tried initializing the form with
   const $form = jQuery(‘.wpcf7-form’);wpcf7.
   init($form[0]);wpcf7cf.initForm($form);but still nothing works. Before including
   your plugin in my form, everything worked for me. What could be the problem?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fvalidation-in-forms-does-not-work%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/validation-in-forms-does-not-work/#post-16839722)
 * You’re close to the solution, but you need to initialise the form at the right
   time. See: [https://conditional-fields-cf7.bdwm.be/docs/troubleshooting/does-not-work-with-a-third-party-theme-or-plugin/#popups](https://conditional-fields-cf7.bdwm.be/docs/troubleshooting/does-not-work-with-a-third-party-theme-or-plugin/#popups)
 *     ```wp-block-code
       <script>
         jQuery(document).on( 'WHEN-THE-TIME-IS-RIGHT', function() {
           const $form = jQuery('.wpcf7-form');
           wpcf7.init($form[0]);
           wpcf7cf.initForm($form);
         });
       </script>
       ```
   
 * ‘WHEN-THE-TIME-IS-RIGHT’ is a fictitious event. You will need to refer to the
   documentation or contact the author of the popup script to find out which event
   to listen to.
 * Here’s an example that works for Elementor popups:
 *     ```wp-block-code
       <script>
         jQuery(document).on( 'elementor/popup/show', function() {
           const $form = jQuery('.wpcf7-form');
           wpcf7.init($form[0]);
           wpcf7cf.initForm($form);
         });
       </script>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Validation in forms does not work’ 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/)

 * 1 reply
 * 2 participants
 * Last reply from: [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/validation-in-forms-does-not-work/#post-16839722)
 * Status: resolved