Search code examples
jquerywordpressgravity-forms-plugin

WordPress Gravity Forms Multiple Forms Multiple Submissions


I have a page with multiple instances of the same Gravity Form short code (with different variable parameters) that open in a light box. Each form is passed variables so that the notification email and other defaults are different even though the form is the same. I would like a user to be able to submit one instance of the form. (Which will be directed to one email) and then submit a different instance of the form (which will be directed to a different email address).

All the items I have mentioned I have working. My challenge is that when I try to open a second instance of the form after having submitted it once already I get the "Thank You" response instead of the form. Is there a way I can use a hook to clear or set something after the form has been sent? Maybe a div needs to be shown or hid?

Same questioned asked here wordpress gravity forms submit multiple times


Solution

  • I can think of two solutions:

    1. Implement the forms in <iframes> so that each form submission truly happens on a separate page even though it gives the illusion of the forms all being available on the same page.

    2. I've written a plugin which allows you to reload any AJAX-enabled form (http://gravitywiz.com/documentation/gp-reload-form/). In the demo, you click a link to reload the form; however, it also provides an option to automatically reload the form after X seconds. Additionally, you can trigger the reload manually (like when the popup containing the form is closed) anywhere in your javascript like so:

      gwrf.reloadForm();