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.

autoclose modal box after validation

  1. sascha
    Member

    Hi there,
    I was wondering if it is possible to launch a form in a lightbox, submit the form, display the validation message in the lightbox and then let the lightbox close automatically after x seconds. Has anyone got any experience with this?

    I have found a few old posts on modal box/lightbox, but they seemed to be outdated. It would be great to get an updated guide though, as it seems like something a lot of people are looking for. Also it would help to keep some topics open longer, in order to contact people that succeeded and ask them for help (that was on a quite recent topic with regards to modal boxes).

    Keep up the good work,
    Sascha

    Posted 12 years ago on Saturday October 22, 2011 | Permalink
  2. Agree. I would like to see the same thing

    Thank you

    Posted 12 years ago on Friday October 28, 2011 | Permalink
  3. sascha
    Member

    Bump! Any ideas anyone?

    Posted 12 years ago on Wednesday November 30, 2011 | Permalink
  4. use this

    http://www.gravityhelp.com/documentation/page/Gform_confirmation_loaded

    to trigger your modal window close function, I've done it before and it works

    Posted 12 years ago on Wednesday November 30, 2011 | Permalink
  5. I put this script in the footer:

    (<script type="text/javascript">
    jQuery(document).bind(‘gform_confirmation_loaded’, function($){
    $.fancybox.close(); //closes the fancybox
    return false;
    });
    </script>)

    and this code in the page:

    (<div class="fancybox-hidden" style="display: none;">
    <div id="fancyboxID-1">[gravityform id="1" ajax="false"]</div>
    </div>)

    Its not working. here is a link: http://4kensingtondrive.com/buyer-tips/6-buyer-mistakes

    thoughts?

    Posted 12 years ago on Monday February 13, 2012 | Permalink
  6. Sasch and Memmon, this worked for you?

    Posted 12 years ago on Tuesday February 14, 2012 | Permalink
  7. The user above is correct, you would have to enable AJAX on the form and use the gform_confirmation_loaded javascript hook to accomplish what you want to do and execute the correct javascript necessary to close the modal window. I can't tell you what the correct javascript is going to be in order to do what you want to do because I am not familiar enough with the lightbox script to know how it is supposed to be done.

    I noticed in your forum post that the code you included had ajax set to false in the shortcode. You need to have ajax set to true. The gform_confirmation_loaded hook is an AJAX only javascript hook.

    When enabling AJAX you are going to have to remove the reCAPTCHA field from your form. reCAPTCHA is not compatible with AJAX forms and therefore if a reCAPTCHA field is present, the form does not load using AJAX.

    You need to remove the reCAPTCHA field from the form and then make sure that you have AJAX enabled on the shortcode. Then use the gform_confirmation_loaded javascript hook to execute whatever javascript you need to execute to accomplish what you want to do.

    Keep in mind that this is a customization and is not officially supported. The techniques and suggestions in that forum post as well as other forum posts that are discussing modal window and lightboxes are entirely user driven customizations. They aren't features or functionality of Gravity Forms itself so they are considered customizations.

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