homepage Welcome to WebmasterWorld Guest from 23.20.63.27
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
on submitting a form how will i open it in a customised window in ie7?
opening a customized window on form submit in ie7
manoj_kgm




msg:3544932
 3:01 pm on Jan 10, 2008 (gmt 0)

<FORM NAME=test ACTION="www?ID=0000" target = "newwin" METHOD="POST" style="margin: 0px" onsubmit = "return window.open('','newwin','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,width=800,height=550')">

i tried to use this . but it didnt work! can anyone help me please?

 

gergoe




msg:3545037
 4:44 pm on Jan 10, 2008 (gmt 0)

I'd suggest to use this:
<FORM NAME=test ACTION="www?ID=0000" target = "_blank" METHOD="POST" style="margin: 0px">
this should already open destination url (www?ID=0000) in a new window. But if you really want to have the new window customized, you might try adding the window.open into the submit button's onclick instead of the form's onsubmit, as there's a chance that the window will be blocked by a popup blocker (or the javascript implementation does not allow windows opened from onsubmit). Most of these software are working in that way, that when the user initiates the opening of the window (by clicking on a button, or link), then it allows it, but any any other case it isn't. Although that's just an idea.

Besides of that if you put "return window.open(...)" into the onsubmit, then the form can not be submitted when the window was not opened (window.open returns false), but when the window is opened, it returns a javascript window object, which is not false, but not true either, so I'd move this command to a function, and return boolean values only to onsubmit.

By the way, I quickly checked it in on both FF2 and IE6, and it was working as expected.

manoj_kgm




msg:3545053
 4:56 pm on Jan 10, 2008 (gmt 0)

Thanks a lot doode! before submitting the form i used this and it worked!

window.open('','newwin','width=450,height=300,status=yes');
document._rfxShowFile.target = "newwin";
document._rfxShowFile.submit();

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved