• Resolved cfoster13

    (@cfoster13)


    Hi, I’m trying to display a custom modal window upon successful submission of the form. I checked the documentation and am using what’s provided, but it doesn’t do anything. I know the function I’m calling which displays the modal works, but it’s not being triggered for some reason. If I put a console log in the script, that doesn’t work either. Am I doing anything wrong here?

    <? add_action('fluentform/before_insert_submission', 'your_custom_before_submission_function', 10, 3);
    
    function your_custom_before_submission_function($insertData, $data, $form){ 
    ?>
      <script> 
        displayModal("#modal");
      </script>
    <?
    }
    ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Tahmid ul Karim

    (@tahmidulkarim)

    Hello @cfoster13,

    The action hook – fluentform/before_insert_submission is triggered before a form is submitted and as you are adding the script before form submission, so it won’t work.

    You can try using this action hook instead – fluentform/before_submission_confirmation

    Check our documentation here.

    Thank you!

    Thread Starter cfoster13

    (@cfoster13)

    Ah, thank you—I had misread the description of before_insert_submission. The modal is now triggering properly, but the functionality that resets or hides the form is being interfered with. Is there an action hook that takes place after that process completes? I’m getting this error:

    {“success”:true,”data”:{“insert_id”:53,”result”:{“message”:”

    Thank you for your message. We will get in touch with you shortly<\/p>”,”action”:”hide_form”},”error”:””}

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Trigger a modal window after successful submission’ is closed to new replies.