---
title: "Re-Open a Popup On Form Submission"
description: "When a form doesn't support AJAX Submission, this code is needed to re-open the form. You'll most likely want this so users can see form submit \"success\" messages. Otherwise, the user might not know if their submission got processed correctly,…"
url: "https://wppopupmaker.com/docs/form-submit-actions/re-open-a-popup-on-form-submission/"
updated: "2024-12-23"
category: Advanced / Form Submit Actions
---

# Re-Open a Popup On Form Submission

When a form doesn't support AJAX Submission, this code is needed to re-open the form. You'll most likely want this so users can see form submit "success" messages. Otherwise, the user might not know if their submission got processed correctly, or if there was an error with their submission.

The `$_POST` key and value in the code below will vary based on your form and will need to be replaced.

Also, make sure you replace the "123" with your proper popup ID # found on the All Popup Screen.

You can add the PHP code snippet to your child theme's `functions.php` file or with a third-party plugin such as [My Custom Functions](https://wordpress.org/plugins/my-custom-functions/).

```
    <?php
    /*
    /* Add the following code to your theme (or child-theme)
    /*   'functions.php' file starting at 'add_action()'.
    */
    add_action( 'wp_footer', 'pum14_popup_reg_form_check', 1000 );
    /*
     * Reopen a non-AJAX submitted form after form submit.
     *
     * @since 1.0.0.
     *
     * @return void
     */
    function pum14_popup_reg_form_check() {
        if ( isset( $_POST['form_id'] ) && $_POST['form_id'] == 'my_form' ) {
            ?>
            <script type="text/javascript">
                PUM.open(123);
            </script>
            <?php
        }
    }
```

View the source on [GitHub](https://github.com/PopupMaker/Library/blob/master/On_Form_Submit_Actions/reopen-form-when-submitted-without-ajax.php).
