• Resolved remcorhee

    (@remcorhee)


    Hi!

    Is it possible to show the form empty after sending, with maybe succesmessage above. Now the form is gone after sending. How to fix this>

    Best regards,

    Remco

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • You may redirect the form back to the page after submit.

    See: https://advancedforms.github.io/guides/available-arguments/#redirect

    Plugin Author fabianlindfors

    (@fabianlindfors)

    Hi, @remcorhee!

    Adrian’s suggestion should work. Another way is to use a snippet like the following (replace FORM_KEY with your actual form key):

    
    function show_form_again( $form ) {
        // By clearing the submission object we stop the form from showing a success message
        AF()->submission = null;
    
        // We must return $form again as this is a filter
        return $form;
    }
    add_filter( 'af/form/before_render/key=FORM_KEY', 'show_form_again', 10, 1 );
    

    This should work as long as you don’t have AJAX submissions enabled!

    If you want to show a success message above, you should be able to echo the message you like from inside that filter ??

    Thread Starter remcorhee

    (@remcorhee)

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display empty form again after submitting’ is closed to new replies.