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.

triggering javascript event when form is submitted

  1. obvio
    Member

    I have a form on a page which is loaded into an iframe (modal) and i'd like to close the modal once the form has been submitted, is there some event fired (in javascript) which i can listen to and close the modal upon successful submission?

    Thanks!

    Posted 12 years ago on Tuesday January 24, 2012 | Permalink
  2. Hi, obvio,

    You could use the "gform_after_submission" (http://www.gravityhelp.com/documentation/page/Gform_after_submission) hook and add some jquery/javascript in it to close your window.

    Posted 12 years ago on Tuesday February 7, 2012 | Permalink
  3. obvio
    Member

    thanks, but finally using that:

    $(document).bind('gform_confirmation_loaded', function(event, form_id){
    	$('#form').delay(3000).fadeOut(600);
    });
    Posted 12 years ago on Tuesday February 7, 2012 | Permalink
  4. Glad you got it working and thanks for the example.

    Posted 12 years ago on Tuesday February 7, 2012 | Permalink

This topic has been resolved and has been closed to new replies.