-
AuthorPosts
-
July 10, 2025 at 5:24 pm #1486608
I have a form that opens in a lightbox upon button press. Once the form is filled out it redirects to a pdf for download. The problem is it stays within the lightbox frame. Is there a way to exit the lightbox and show the pdf after form submission? Thanks!
July 11, 2025 at 7:50 am #1486634Hey cnpetr,
Thank you for the inquiry.
There’s no built-in option for this by default, but you can try creating custom script to close the lightbox on form submission or when the submit button is clicked. For example:
jQuery(document).on('av_resize_finished', function() { setTimeout(function() { if (jQuery('.ajaxresponse:visible').length) { // close popup here // open a new tab with the pdf } }, 300); });OR
jQuery(document).ready(function($) { $('.avia_ajax_form input[type="submit"]').on('click', function(e) { // close popup here // open a new tab with the pdf }); });Another alternative is to place the download form on its own page instead of using a lightbox.
Best regards,
IsmaelJuly 11, 2025 at 11:37 am #1486647what kind of form is it? If you are using contact form 7 you can listen to wpcf7mailsent and after a time you can close the popup with it.
maybe your form got something similar.for example you can close a magnificPopup by adding this to your popup function:
document.addEventListener( 'wpcf7mailsent', function( event ) { setTimeout(function() { $.magnificPopup.close(); }, 1000); }, false );July 11, 2025 at 5:00 pm #1486664Thank you both! I’ve gone ahead and made it a page instead of using the lightbox for now.
July 12, 2025 at 10:11 am #1486685 -
AuthorPosts
- You must be logged in to reply to this topic.
