Home > Software design >  Force iframe to open in new window
Force iframe to open in new window

Time:04-05

I have embedded form from the external resource:

<iframe id="iframeID"  src="https://ansokan.rahfo.se/page/login/LoginFrame.aspx" name="auth" scrolling="no" sandbox="allow-forms allow-orientation-lock allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-presentation allow-scripts allow-top-navigation allow-top-navigation-by-user-activation"></iframe>

When it's submitted I want it to open in a new tab which doesn't happen. I tried all "sandbox" parameters but it didn't help.

Can anyone help me with that?

CodePudding user response:

There is no way to control what frame/window a form on a third-party webpage targets.

If you want them to target a new tab then you’ll need to ask them to change their page.

CodePudding user response:

you can't Force iframe to open in a new Tab, since it is an html element like any other elements Such as p , div and h1 ... it is a part of your webpage that should be rendered.

if you have something to display in another Tab , you can wrap it in '<a>' tag and add this attribute target="_blank".

<a target="_blank" href="www.google.com"/>
  • Related