Add shortcode to form | WordPress.org

[ad_1]

Hello @ra2or

No, I’m sorry, that’s not possible because we cannot ensure the final code doesn’t break the form structure. However, you can insert the shortcode on the same page where you inserted the form, and move the resulting code into the form after it is rendered.

For example, assuming you have the shortcode [my-shortcode] and want to display its result in the form. First, you must insert the shortcode into the form by using a tag similar to:

<div id="outside-container">[my-shortcode]</div>

Finally, insert an “HTML Content” field in the form with the following piece of code as its content:


<div id="inside-container"></div>
<script>
fbuilderjQuery(document).one('formReady', function(){
fbuilderjQuery('#inside-container').html(fbuilderjQuery('#outside-container').html());
});
</script>

The previous code moves the code generated by the shortcode into the form after rendering the form. Please remember to insert the form shortcode on the same page.

Best regards.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer