Ajax modal popup
-
Hi I’m Nicola,
first of all thank you for this plugin.My problem is that I have a cf7 form loaded with Ajax from a calendar’s event.
So when an event is clicked, the form will print into a modal (bootstrap).The CF7 is triggered in a function inside functions.php with:
$output = do_shortcode('[contact-form-7 id="'.$id.'" html_class="cf7_custom_style_1"]'); echo $output;
and wpcf7.initForm is initialized with a js inside the same function:
jQuery('.wpcf7 > form').each(function(){ var $form = jQuery(this); wpcf7.initForm($form); if(wpcf7.cached){ wpcf7.refill($form);} });
All seems to work eccept for conditional fields.
So I reload conditional fields scripts.js after the wpcf7 is fired like this:
jQuery.getScript('../../../wp-content/plugins/cf7-conditional-fields/js/scripts.js',function(){});
This method get everything works, but I don’t think that is a good workaround.
I’ve also tried with a js that load the script once instead of load it every time, but the form work just the first time. If I dismiss it and open it again from the event the conditional fields stop work.
I hope that I was clear enough, unfortunately I can’t provide a link with the page because it’s in a dev test domain.
Thanks, hope to hear from you a solution.
Bests
- The topic ‘Ajax modal popup’ is closed to new replies.