I'm using a script to create a popup button. The message that appears in the popup comes from a JavaScript file. Part of that includes a WordPress shortcode to display a form from Caldera Forms, although this could really be any form and any shortcode. My script currently looks like this:
bioEp.init({
html: '<div id="bio_ep_content">' +
'<h2>Contact Form</h2>' +
'<p>Submit your contact details here.</p>' +
'<?php echo do_shortcode("[caldera_form id="CF5b425517a3263"]"); ?>' +
'</div>',
css: '#bio_ep {width: 65%; max-width: 800px; height: auto; background-color: #fff; text-align: center; padding: 25px}',
delay: 1,
cookieExp: 0
});
It's all good except the form doesn't appear. The shortcode appears like a comment. Like this:
<!--?php echo do_shortcode("[caldera_form id="CF5b425517a3263"]"); ?-->
Is there someway to make the shortcode work within this JavaScript?