Output form via JavaScript vars doesn’t work
-
Output the wpcf7 form via JavaScript vars doesn’t work.
For example, imagine some function “on click”
jQuery('.some-button').on('click', function () { jQuery.dialog({ content: new_vars.content }); }Then in php will add a Shotcode to this var
wp_localize_script('some-script', 'new_vars', array( 'content' => do_shortcode('[contact-form-7 id="1"') ) );As result, the form will normally output as /* <![CDATA[ */ in html code and will normally output visually.
But the form will never work as expected! Validating data after hitting submit button will cause reload page instead of showing result.The only way is to use direct echo do_shortcode without vars, but it’s not what I need.
Hope you will add support in future for properly working form when it output from JavaScript var.Thank you!
The topic ‘Output form via JavaScript vars doesn’t work’ is closed to new replies.