Javascript inside the Quform Pre display action

Home Forums Quform WordPress Javascript inside the Quform Pre display action

This topic is: not resolved
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #23701
    Venom
    Participant

    Hi Ally,

    Is it valid to place javascript inside the pre display function? Once I put the javascript snippet to the pre_display action, in the preview form of Form editor it shows “An error occurred loading the preview (Ajax error)”,


    <?php
    add_action('quform_pre_display_XX', function (Quform_Form $form) {
    ?>
    <script>
    alert('test');
    </script>
    <?php
    });
    ?>

    Regards,

    Venom

    #23702
    Venom
    Participant

    I have tried to put it into the jQuery document ready function as well, it still showed “An error occurred loading the preview (Ajax error)”, However, it could prompt the alert test message on the front end.

    <?php
    add_action('quform_pre_display_XX', function (Quform_Form $form) {
    ?>
    <script>
    jQuery(document).ready(function($){
    alert('test');
    });
    </script>
    <?php
    });
    ?>

    #23747
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2025 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy