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

can form.submit() submit another form?

P: n/a
Can form.submit() submit another form? In the following example, in
page1.asp, it is fine to submit the current form: form1.submit(), and and I
could see the value "Joe" in page2.asp. However, if I do: form3.submit(),
then it couldn't go to page2.asp. Any ideas?? Thanks!!

//page1.asp
<html>
<head>
</head>
<body onload="form1.submit()"> //OK!
<!-- <body onload="form3.submit()"> //Doesn't work!! -->
<form name="form1" action="page2.asp" method="post">
<P><input type="text" name="fname" value="Joe">
</form>
</html>

//page2.asp
<%= Request.Form("fname") %>

//page3.asp
<form name="form3" action="form2.asp" method="post">
<P><input type="text" name="fname" value="Joe">
</form>
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Matt" wrote in message news:ej**************@TK2MSFTNGP10.phx.gbl...
: Can form.submit() submit another form? In the following example, in
: page1.asp, it is fine to submit the current form: form1.submit(), and and
I
: could see the value "Joe" in page2.asp. However, if I do: form3.submit(),
: then it couldn't go to page2.asp. Any ideas?? Thanks!!
:
: //page1.asp
: <html>
: <head>
: </head>
: <body onload="form1.submit()"> //OK!
: <!-- <body onload="form3.submit()"> //Doesn't work!! -->
: <form name="form1" action="page2.asp" method="post">
: <P><input type="text" name="fname" value="Joe">
: </form>
: </html>
:
: //page2.asp
: <%= Request.Form("fname") %>
:
: //page3.asp
: <form name="form3" action="form2.asp" method="post">
: <P><input type="text" name="fname" value="Joe">
: </form>

Right. You cannot submit form3 from page1.asp. You submit the form from
the page you are on. Even if you call a form on an open page, you are
submitting from that page.

If page3.asp was a popup and had a handle of page3, then you could call for
the form to submit from page1.
page3.document.form3.submit()

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp

Jul 19 '05 #2

P: n/a
hi, with popup window opener with window.open you can use this too:
window.opener.frmX.submit();

regards,

««««««««»»»»»»»»»»»»»»
Vlmar Brazão de Oliveira
Desenvolvimento Web
HI-TEC
"Roland Hall" <nobody@nowhere> escreveu na mensagem
news:eK**************@TK2MSFTNGP12.phx.gbl...
"Matt" wrote in message news:ej**************@TK2MSFTNGP10.phx.gbl...
: Can form.submit() submit another form? In the following example, in
: page1.asp, it is fine to submit the current form: form1.submit(), and and I
: could see the value "Joe" in page2.asp. However, if I do: form3.submit(), : then it couldn't go to page2.asp. Any ideas?? Thanks!!
:
: //page1.asp
: <html>
: <head>
: </head>
: <body onload="form1.submit()"> //OK!
: <!-- <body onload="form3.submit()"> //Doesn't work!! -->
: <form name="form1" action="page2.asp" method="post">
: <P><input type="text" name="fname" value="Joe">
: </form>
: </html>
:
: //page2.asp
: <%= Request.Form("fname") %>
:
: //page3.asp
: <form name="form3" action="form2.asp" method="post">
: <P><input type="text" name="fname" value="Joe">
: </form>

Right. You cannot submit form3 from page1.asp. You submit the form from
the page you are on. Even if you call a form on an open page, you are
submitting from that page.

If page3.asp was a popup and had a handle of page3, then you could call for the form to submit from page1.
page3.document.form3.submit()

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp MSDN Library - http://msdn.microsoft.com/library/default.asp

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.