Does anyone know how to set the target of a HTML FORM to a newly created pop-up window in Chrome 20+. The below code works in every browser, even worked in previous versions of Chrome, except Chrome 20+:
var f = document.getElementByID("my_form");
window.open('','popup_win','scrollbars=yes,menubar=no,height=500,width='+(screen.width>1100?1100:screen.width)+',resizable=yes,toolbar=no,status=no,location=0');
f.target = this.win;
f.submit();
This code creates a new window, but it doesn’t contain the resulting form submission page content.
We need to use “window.open” so we can best set the size of the window for our application to be displayed.
After doing some research it appears that it has to do with the Chrome Popup blocker. (New Window Links Not Working with Chrome). After I added the site to the “Always allow” list in Chrome the content displayed.
Anyone know how to do this type of thing without any user interaction?
Thanks for your help!
This was the cause of Chromes pop-up blocking settings, once added to allow sites it displayed correctly.
Added a message above the button for chrome users, if a blank window add our site to your allow popup sites.