473,396 Members | 2,002 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,396 software developers and data experts.

Post multiple forms

Is it possible to post all (or more of one) forms simultaneosly?

document.forms.submit?

Any help appreciated.

Regards.

--
Fabri
(Incredibile come si tenda a credere di piu` a Rossi. (cit.))
Jul 23 '05 #1
6 7649
"Fabri" <no@sp.am> wrote in message news:34*************@individual.net...
Is it possible to post all (or more of one) forms simultaneosly?

document.forms.submit?

Any help appreciated.

Regards.

--
Fabri
(Incredibile come si tenda a credere di piu` a Rossi. (cit.))


I don't think you can. I tried the following:

<html>
<head>
<title>submit2.htm</title>
<script type="text/javascript">
function submit2() {
document.form1.submit();
alert(1);
document.form2.submit();
alert(2);
}
</script>
</head>
<body>
<form action="submit2.htm" method="get" name="form1">
<input type="text" name="text1" value="1">
</form>
<hr>
<form action="submit2.htm" method="get" name="form2">
<input type="text" name="text2" value="2">
</form>
<hr>
<input type="button" value="Submit Forms" onclick="submit2()">
</body>
</html>
Jul 23 '05 #2


Fabri wrote:
Is it possible to post all (or more of one) forms simultaneosly?


Well probably only if the target is set differently or to a new window e.g.
for (var i = 0; i < document.forms.length; i++) {
document.forms[i].target = '_blank';
document.forms[i].submit();
}
If you have forms with no target set then obviously submitting one means
unloading the current page and then there are not further forms to submit.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #3
Martin Honnen wrote:
Well probably only if the target is set differently or to a new window e.g.
for (var i = 0; i < document.forms.length; i++) {
document.forms[i].target = '_blank';
document.forms[i].submit();
}

AWESOME!!!!!!

--
Fabri
(Incredibile come si tenda a credere di piu` a Rossi. (cit.))
Jul 23 '05 #4
rf
"Martin Honnen" <ma*******@yahoo.de> wrote


Fabri wrote:
Is it possible to post all (or more of one) forms simultaneosly?
Well probably only if the target is set differently or to a new window

e.g. for (var i = 0; i < document.forms.length; i++) {
document.forms[i].target = '_blank';
document.forms[i].submit();
}
Which will result in a plethora of new windows popping up.
If you have forms with no target set then obviously submitting one means
unloading the current page and then there are not further forms to submit.

Why not just cause the server side form handler to return, say, a 204, there
is no new information to send back? That way the existing page will remain.

--
Cheers
Richard.
Jul 23 '05 #5
rf wrote:

[CUT]
Why not just cause the server side form handler to return, say, a 204, there
is no new information to send back? That way the existing page will remain.

Can you give us an example please?

Regards.

--
Fabri
(Incredibile come si tenda a credere di piu` a Rossi. (cit.))
Jul 23 '05 #6
rf
"Fabri" <no@sp.am> wrote
rf wrote:

[CUT]
Why not just cause the server side form handler to return, say, a 204, there is no new information to send back? That way the existing page will
remain.
Can you give us an example please?


You are probably better off asking over in the server side groups. alt.php,
comp.lang.php, or whatever flavour of server side stuff you use.

Here is a minimal PHP example:

In your "page"

<form action="updatedatabase.php" ...>
....

In updatadatabase.php:

<?php
header("HTTP/1.0 204 No Response"); // terminates this HTTP request
// do stuff with the data sent up by the form
// do not output any "content" for this request. That is, no html.
// the sole purpose of this "page" is to update a database or something.
?>

Google for: php 404 header

--
Cheers
Richard.
Jul 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Nomen Nescio | last post by:
can anyone be so kind as to look at http://www.mysolution.ws/HYPOCRITE.php and let me know why it isn't passing the form data to http://www.mysolution.ws/insertHYPOCRITES.php for the most...
1
by: humbads | last post by:
I am trying to get a popup window to work for editing notes in my application. Here's how I implemented it: The original frame is called ORIGINALFRAME and contains a link like this: <a...
0
by: jon | last post by:
Using Visual C++ and MFC, one could generate a very nice MMI using CFormView and the method detailed in the MSDN "vswap" example to allow multiple forms to be viewed ( switched to ) within a single...
2
by: Ghafran Abbas | last post by:
Call this function from the Page_OnLoad event of your asp.net page. This will prevent the user from doing multiple post backs or button clicks. This was designed to not disable the button, because...
2
by: John Granade | last post by:
I'm looking for the best way to make a dataset available from multiple Windows forms. The dataset is created from an XML file. I have a main form (frmMain) that loads the dataset and reads the...
6
by: salmobytes | last post by:
After a javascript-generated post event (this is a post, not ajax messaging) the current screen has to be redrawn. But on *long forms* (longer than a single screen) then the current screen...
6
by: Bob Alston | last post by:
Looking for someone with experience building apps with multiple instances of forms open. I am building an app for a nonprofit organizations case workers. They provide services to the elderly. ...
0
jimleon
by: jimleon | last post by:
I have a post form for adding news articals to our website. It sends the headline and content and which category it belongs to to our MySQL database. This all works fine if a single category is...
5
by: Neil | last post by:
"lyle" <lyle.fairfield@gmail.comwrote in message news:48c3dde7-07bd-48b8-91c3-e157b703f92b@f3g2000hsg.googlegroups.com... Question for you. I'm doing something similar, only, instead of opening...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.