• Resolved fijisunshine

    (@fijisunshine)


    Great plugin!

    My form has 3 steps. On the last step, the form disappears after I click the ‘Submit’ button and the submission is successful. This doesn’t occur on the first 2 steps when I click the ‘Next’ button.

    I would like the form to remain after the submission. That way it will display the message indicating that it was successfully submitted.

    What could be causing the entire form to disappear after submission?

    Thank you

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author webheadcoder

    (@webheadllc)

    I believe this is default behavior for Contact Form 7. You can probably get better help on their forum or website.

    https://contactform7.com/

    Thread Starter fijisunshine

    (@fijisunshine)

    Thanks for your note. Allow me to clarify as I do not think this is default behavior. After submitting a normal CF7 form, the form remains on the page and the form displays the message indicating that it was sent successfully.

    When the CF7 Multi-Step form is submitted, the form immediately disappears. At least, this is what occurs on my site. I’d like for the form to remain so that users can read the message indicating its successful submission. Any suggestions?

    Thank you

    Plugin Author webheadcoder

    (@webheadllc)

    Ah sorry about that. The form disappearing is caused by this plugin. You should see the message about the form being successfully sent though.

    The reason the form gets hidden is because the user is on the last step and would not be able to re-submit the form.

    If you are able to add javascript to the page you can re-show the form using the code below:

    document.addEventListener( 'wpcf7mailsent', function( e ) {
      jQuery('#' + e.detail.unitTag + ' form').children().show();
    });
    • This reply was modified 8 years, 1 month ago by webheadcoder.
    Thread Starter fijisunshine

    (@fijisunshine)

    Thanks for providing the javascript code. I’m familiar with adding scripts and functions to WordPress sites. However, this js code doesn’t appear to work.

    Did you test the snippet on your site and it worked? I included it in functions.php with an add_action on wp_footer, it doesn’t appear to work.

    Any suggestions? Thanks again

    Plugin Author webheadcoder

    (@webheadllc)

    hmm make sure it’s enclosed in the <script> tags.

    <?php 
    function my_function() {
    ?>
    <script>
    document.addEventListener( 'wpcf7mailsent', function( e ) {
      jQuery('#' + e.detail.unitTag + ' form').children().show();
    });
    </script>
    <?php
    }
    add_action( 'wp_footer','my_function' );

    I’m having a similar problem. When the form is submitted on the last step the “Success message” does not appear. The form just disappears.

    Is there a fix to make sure the success or error message is displayed?

    Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Form disappears after submission’ is closed to new replies.