Support » Plugin: Easy FancyBox - WordPress Lightbox Plugin » Easy Fancybox and Ajax calls.

  • Resolved cheeseshark

    (@cheeseshark)


    I am using Easy Fancybox and iframes to display Gravity Forms content. The content shows up properly in the lightbox but things seem to be not working properly when I use Gravity Forms events (gform_after_submission).

    I use the submission event to call a javascript function which calls an ajax function to save data to the database. The event code calls the javascript properly, but the ajax call to the php code (from the page that I launch the fancybox from) never fires.

    When the fancybox is loaded, will that change the way ajax functions? Is it possible that the fancybox is considered a different page than the originating page and therefor the code is “missing” when it tries to call it?

    I’m at a loss as to why this isn’t working … the code works when I fire it directly from a button. Is there a way to force the fancybox to close prior to calling the javascript code right now, the box hangs open until the attempt to make the ajax call is completed.

    Thanks for the help.

    https://wordpress.org/plugins/easy-fancybox/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Is it possible that the fancybox is considered a different page than the originating page and therefor the code is “missing” when it tries to call it?

    You are using iframe mode, which means it is indeed considered a different page.

    Can you share a link?

    Thread Starter cheeseshark

    (@cheeseshark)

    It is in a protected area of the site I am working on (you need to be authenticated on the site to see the page).

    I can do that, but would prefer to do it in private so I don’t get a glut of people spam registering on the site.

    Thread Starter cheeseshark

    (@cheeseshark)

    I sent an email through the contact form on the plugin website with more information.

    So the form is in fact living on another page and you are linking to that page with class=”fancybox-iframe” to make it open in the lightbox?

    Thread Starter cheeseshark

    (@cheeseshark)

    So the form is in fact living on another page and you are linking to that page with class=”fancybox-iframe” to make it open in the lightbox?

    The content is loaded via a shortcode … I am not lightboxing another page on the site.

    <div style="display:none" class="fancybox-hidden"><div id="fancyboxID-1" style="width:800px;height:425px">
    <?php
            $vcl_c = '526';
            $gfsc = '[gravityform id="1" ajax="true" field_values="fc_itemID='.$vcl_c.'"]';
            echo do_shortcode($gfsc);
    ?>
    </div></div>

    I am not lightboxing another page on the site.

    Then you should not use iFrame mode. Use Inline Content mode with class=”fancybox-inline”.

    Thread Starter cheeseshark

    (@cheeseshark)

    Then you should not use iFrame mode. Use Inline Content mode with class=”fancybox-inline”.

    I am … sorry about the confusion.

    $fc_button_link = '<a href="#fancyboxID-'.$org_link.'" class="fancybox-inline">';

    I got your email. Will look into it and let you know 🙂

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Easy Fancybox and Ajax calls.’ is closed to new replies.