Reply To: Open success url from with Fancybox

Your Account / Forums / Easy FancyBox Pro / Open success url from with Fancybox / Reply To: Open success url from with Fancybox

November 14, 2014 at 6:27 pm #3979

Hi Ines, it looks like the code snippet you use is from fancyBox2 not FancyBox. Although a bit similar, these two lightboxes are not the same. You can see an example of how this ajax snippet would need to look like on http://fancybox.net/blog.

At first glance, I would change


url: "http://www.velodrombiketours.com/newsletter/activar.html", // success.php

to


url: "http://velodrombiketours.ip-zone.com/ccm/subscribe/index/form/", // submit.php

because that parameter is supposed to hold the submission URL, not the thank you message page.

But even then, FancyBox will expect an ajax response which is not what that submit URL will give… When using FancyBox in conjunction with an ajax form submission, you NEED to have control over both the form and the submission response to be able to make them work together nicely. I do not think that you have that since this is an external mailing list provider. Or am I mistaken?

My guess is that you’ll need to approach this differently.

Since you are not allowed to change the submission form AND you cannot change the response to fit your case, BUT you still want all of this to happen within a lightbox, you will need to start the whole proces inside a lightboxed iframe.

1. Create a stand-alone HTML file (complete with basic html/head/body tags and style rules) and place your registration form inside it.
2. Upload it to an accessible place on your webserver/hosting space.
3. Create a link on your WordPress site to that stand-alone html page.
4. Give that link a target="_blank" attribute and style it as a button (for example) to fit your sites design.
5. Test your button and form. It should (at this point) open in a new tab, the form needs to look good and form submission should work.
6. Finally, if all works well, give that link a class="fancybox-iframe" attribute and make sure you activate the iFrame option on your Settings > Media admin page.

From then on, the form will open in a lightbox and both submission and response will (should) happen within that same lightbox iframe.