DesiLogi Posted February 13 Report Share Posted February 13 Hi, I have a submission form that opens in an iframe in a FancyBox over a parent page. When the user submits the form the Destination has some code in it to open a new tab in the parent browser, with a new page. Sometimes there's no issue with a popup blocker but sometimes there is-and the user will rarely see the message in time to allow it. I realize that window.open can trigger a popup blocker unless it's user-triggered. The fact that this code is in the Destination section of the submission form must make it 'non-user triggered', I think, and so the popup blocker is engaged. Is there a way to open a new tab (in the parent section, not the iframe the submission form is in) from the Destination section that avoids a popup blocker? This is the current code: if(v_virt=="proposal"){ setTimeout(window.open('../../proposals/proposal?ProjectID=[@field:ProjectID]&ProposalID=[@field:ProposalID]&runnew=yes&cbResetParam=1','_blank'),1000); setTimeout(window.parent.jQuery.fancybox.close(),2000); } Thanks for any help! Quote Link to comment Share on other sites More sharing options...
foodblogger0919 Posted March 14 Report Share Posted March 14 To bypass potential popup blockers, consider using target="_blank" within the form itself (parent section) instead of window.open in the destination section. This triggers the user's explicit action and reduces popup blocker interference. Alternatively, explore window.postMessage for cross-window communication. The parent window can listen for the message and open the new tab, providing a user-initiated feel. Quote Link to comment Share on other sites More sharing options...
DesiLogi Posted March 15 Author Report Share Posted March 15 Hi @foodblogger0919, Thanks for the tip--though I'm not understanding your first suggestion. When you say use 'target_blank within the form itself and not the destination 'window.open', how does that work? Because it's only in the Destination section that the new ID numbers for the new record can be accessed, correct? I wouldn't be able to direct the page to a new destination with parameters from the record created, if I use a call from the form itself. Unless you mean something different? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.