Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Javascript (http://www.velocityreviews.com/forums/f68-javascript.html)
-   -   Odd behavior (http://www.velocityreviews.com/forums/t915802-odd-behavior.html)

anna 01-14-2005 01:29 AM

Odd behavior
 
I have a javascript that submits form to a new popup window. when the
user is done with the popup, they close it by clicking on a button
coded with window.close().

function popup(url){
var formObj = document.forms['frmMain'];
window.open(url,'frmNew','.....');
formObj.target='frmNew';
formObj.method = "post";
formObj.action = url;
formObj.submit();
}

A small window popups fine and closes fine. However, after the popup
window is closed, any submitform from the original form (frmMain in
this case) will open a new window instead of submit the form to the
same window. wonder what the problem is and how to correct it?

function submitform(url){
document.frmMain.action = url;
document.frmMain.method = "post";
document.frmMain.submit();
}


Lee 01-14-2005 03:27 AM

Re: Odd behavior
 
anna said:
>
>I have a javascript that submits form to a new popup window. when the
>user is done with the popup, they close it by clicking on a button
>coded with window.close().
>
>function popup(url){
>var formObj = document.forms['frmMain'];
>window.open(url,'frmNew','.....');
>formObj.target='frmNew';
>formObj.method = "post";
>formObj.action = url;
>formObj.submit();
>}
>
>A small window popups fine and closes fine. However, after the popup
>window is closed, any submitform from the original form (frmMain in
>this case) will open a new window instead of submit the form to the
>same window. wonder what the problem is and how to correct it?
>
>function submitform(url){
>document.frmMain.action = url;
>document.frmMain.method = "post";
> document.frmMain.submit();
>}


The problem is that you've set the target of frmMain to "frmNew".
If you don't want that, set it back to "" or maybe "_self".



All times are GMT. The time now is 04:36 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.