Hi, I have a contact form that opens in an iframe popup. At submit I want to redirect to a page with a video on. However, the redirect page opens in the iframe. I want it to open on the same main page. Is there a way to set target=”top” for the redirect link? Thanks
Hey matbcn,
Thank you for the inquiry.
How did you add the contact form? Is it the contact form element from the theme? Please post the site or page URL containing the popup so that we could properly inspect it.
Best regards,
Ismael
Hi,
Thank you for the inquiry.
The script that is responsible for the contact form redirect is independently executed in the iframe, so the actual or main page does not refreshed after sending the form. We might be able to adjust the script so that it opens in a new tab or force a page refresh, but we have to modify the enfold\config-templatebuilder\avia-shortcodes\contact\contact.js directly around line 219.
This is the redirect script.
if(redirect_to && action != redirect_to)
{
form.attr('action', redirect_to);
location.href = redirect_to;
// form.submit();
}
We should be able to instead use the window.open function and add the _blank attribute so that it opens a new tab.
if(redirect_to && action != redirect_to)
{
form.attr('action', redirect_to);
window.open( redirect_to, '_blank' );
// form.submit();
}
You may have to use the absolute URL of the video page in order for this to work correctly.
Best regards,
Ismael