Viewing 1 replies (of 1 total)
  • Plugin Author Jules Colle

    (@jules-colle)

    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

    <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:

    <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.