By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,689 Members | 1,915 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,689 IT Pros & Developers. It's quick & easy.

Odd behavior

P: n/a
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();
}

Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Lee
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".

Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.