PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

refresh form after ajax submit

  1. Hi Guys,
    I could do with a form submitting (via AJAX), displaying the thanks message, waiting 5 secs (or so) then refreshing back to an empty form. Is this possible?

    Thanks in advance

    Posted 13 years ago on Friday July 1, 2011 | Permalink
  2. ok, I've inserted the form shortcode in the confirmation box and i've got as far as this:

    <div id="messagethisperson">
    <div id="messagethispersoninner">
    <div id="messagethispersonclose">Close</div>
    <script type="text/javascript">
    jQuery(document).bind('gform_confirmation_loaded', function(event,11){
    jQuery('#messagesent').fadeIn();
    });
    </script>
    <p id="messagesent">Your message has been sent</p>
    <?php gravity_form(11, false, false, false, '', true); ?>
    </div>
    </div>

    What do I put in the 'event' variable??

    The form submits fine, I just want the message sent bit to fade in. Once this is triggered I can clear the form field via jquery and it will look like its a fresh form. I just can't get the jquery function to fire when the form has been submitted

    Posted 13 years ago on Friday July 1, 2011 | Permalink
  3. ok, I tried removing the form shortcode and it worked fine. however, it won't refresh the form back to an empty set of fields. Is there any way to do this??

    Posted 13 years ago on Friday July 1, 2011 | Permalink
  4. removed the shortcode from the confirmation setting by the way ;)

    Posted 13 years ago on Friday July 1, 2011 | Permalink
  5. is there any way to force the form to reset after successful submission?

    Posted 13 years ago on Friday July 1, 2011 | Permalink
  6. ok, managed it.

    used the confirmation loaded function to reload another page via jquery post which has nothing but the same form in it.

    works a treat, just have to make sure that the page template loads no other content (sidebars etc), just displays the form.

    Posted 13 years ago on Monday July 4, 2011 | Permalink