• Resolved chrisosaur

    (@chrisosaur)


    hello,

    I need to be able to embed the iframe of my google appointment calendar so that people can book a meeting time slot while filling out the form.

    I currently have it set up so people fill out the form and then have to go to another page to book a meeting time. People are not going through the other page to book the meeting so I am trying to make it part of the form

    The html embed feature does not work. I just want the google appointment booking to be part of the form ??

    • This topic was modified 5 months, 2 weeks ago by chrisosaur.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Saurabh – WPMU DEV Support

    (@wpmudev-support7)

    Hello @chrisosaur

    Hope you’re doing well today! Thank you for reaching out to us.

    By default, the HTML field in Forminator filters out the “iframe” and “script” tags for security reasons, hence when iframe is added to the HTML field it won’t work directly.

    However, you can add the snippet below to help render the iframe within the form.

    <?php
    if ( ! function_exists( 'wpmudev_forminator_enable_iframe' ) ) {
        function wpmudev_forminator_enable_iframe() {
            $form_exists = has_shortcode( get_the_content(), 'forminator_form' );
            if ( $form_exists ) {
                ?>
                <script type="text/javascript">
                (($, d) => {
                    $(d).ready(function() {
                        $("#forminator-module-33 #html-1").html('YOUR_IFRAME_GOES_HERE');
                    });
                })(jQuery, document);
                </script>
                <?php
            }
        }
        add_action( 'wp_footer', 'wpmudev_forminator_enable_iframe', 9999 );
    }
    ?>

    You will need to use the custom snippet as a mu-plugin and upload it to the /wp-content/mu-plugins/ directory.

    Below are the steps on how you can use it:

    1. You will need to create a new php file and paste the snippet there, the name of the file can be anything (for example: forminator-allow-html.php)

    2. On the line
    $("#forminator-module-33 #html-1")
    Please update the “33” with your form ID, the form ID is the number that you see on the form shortcode. Further, “#html-1” is the field ID of the HTML field. This will define where the iframe will be rendered. (you need to leave the “html-1” field blank on the form)

    3. On the line YOUR_IFRAME_GOES_HERE
    Here, you need to replace the text with the actual iframe SRC of your Google Calendar and save the changes.

    4. Lastly, upload the snippet as a mu-plugin by navigating to the /wp-content/mu-plugins/ directory and that’s it. Here is a guide about using mu-plugins: https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins

    After the snippet is uploaded, it should render the Google Calendar via “iframe” within the form on the frontend.

    Hope this helps.

    Kind Regards,
    Saurabh

    Plugin Support Dmytro – WPMU DEV Support

    (@wpmudevsupport16)

    Hello @chrisosaur,

    I hope that you are doing good today!

    Since we have not received a response from you in a while, I will mark this thread as resolved. Please let us know if you require any additional help.

    Best Regards,
    Dmytro

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.