473,385 Members | 1,154 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

can form.submit() submit another form?

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
2 5531
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: monika | last post by:
hi ... I have an asp page which has 3 buttons. <p align="center"><input class="button" type="button" onClick="location='welStudent.asp';" value="Click to write a new story"></p> <p...
2
by: Terence Parker | last post by:
How does one go about submitting a form with a link - but submitting it to a new window AND to a page different to that described within the action="" option of the <form> tag? Say, for example,...
4
by: Sarah | last post by:
Hi all. I have a form, and several text and image links on it that should submit the form with different actions. I prepared a simple page with just the code that's not working. PROBLEM:...
15
by: M Smith | last post by:
I have a form I want to submit to itself. I want to be able to type in a list of numbers and submit the form and have that list show up on the same form under the text box I typed them into and...
6
by: CJM | last post by:
Can somebody clarify if/how/when a simple form is submitted when the <Enter> key is pressed? As I understood it, if you have a form with a single submit button, if enter is pressed, the form...
4
by: Stuart Perryman | last post by:
Hi, I have the following code which works just fine in IE6 but not in Firefox. It is an extract of several table rows each with an individual form. It is generated by php. <form...
5
by: rjames.clarke | last post by:
I have the following. $result=mysql_query($sql); $nrows=mysql_num_rows($result); for ($i=0;$i<$nrows;$i++) { $row_array=mysql_fetch_row($result); echo "<form name='testform'...
5
by: Navillus | last post by:
Hey gang, I have a login form that is empty by default, but can be filled with values from a previous form: <input type=text maxlength="40" size="40" name="user" value="`usr`"> <input...
1
by: gbezas | last post by:
Hi All, I have added an event handler to redirect form.submit() to a newSubmit() method that I have defined (which does some additional processing before submitting the form). Additionally I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.