473,791 Members | 3,090 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple form submit using single button

21 New Member
Hi,

I need to submit multiple forms with using single button. I've mentioned my code below.

<?
if(isset($_POST )){
print_r($_POST) ;
}
?>
<script type="text/javascript">
function form2Submit() {
document.f2.act ion="formsubmit 2.php"
document.f2.sub mit();
alert('Form2 Submitted');
}

function form1Submit() {
document.f1.act ion="formsubmit 2.php"
document.f1.sub mit();
document.getEle mentById("t1"). value = '';
alert('Form1 Submitted');
}


function submitAllForm() {
form1Submit();
form2Submit();
}
</script>
</HEAD>

<body>
<form name="f1" method="post">
F1 NAME: <input type="text" name="t1" id="t1" size="24" value="txt1" />
</form>
<form name="f2" method="post">
F2 NAME: <input type="text" name="t2" id="t2" size="24" value="txt2" />
</form>
<input type="button" value="Submit" onClick="submit AllForm()" />
</body>

Its working properly in IE but not in Mozilla. do you have any idea ?

Thanks.
Dec 20 '07 #1
1 2473
rpnew
188 New Member
Hi,

I need to submit multiple forms with using single button. I've mentioned my code below.

<?
if(isset($_POST )){
print_r($_POST) ;
}
?>
<script type="text/javascript">
function form2Submit() {
document.f2.act ion="formsubmit 2.php"
document.f2.sub mit();
alert('Form2 Submitted');
}

function form1Submit() {
document.f1.act ion="formsubmit 2.php"
document.f1.sub mit();
document.getEle mentById("t1"). value = '';
alert('Form1 Submitted');
}


function submitAllForm() {
form1Submit();
form2Submit();
}
</script>
</HEAD>

<body>
<form name="f1" method="post">
F1 NAME: <input type="text" name="t1" id="t1" size="24" value="txt1" />
</form>
<form name="f2" method="post">
F2 NAME: <input type="text" name="t2" id="t2" size="24" value="txt2" />
</form>
<input type="button" value="Submit" onClick="submit AllForm()" />
</body>

Its working properly in IE but not in Mozilla. do you have any idea ?

Thanks.
Hi,

Whats the error you are getting???

Regards,
RP
Dec 21 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2359
by: Phillip Windell | last post by:
This is really an HTML question I think, but it probably won't take much effort to answer (unless I'm answering or course). The HTML is all ASP generated and the ASP generates exactly what I want but the resulting HTML isn't working right. It consists of multiple forms on a page with each form using a unique name. The submit button in each form also uses a unique name. The forms are supposed to submit a single value from a hidden field...
4
6139
by: shank | last post by:
Visually, the page will look somewhat like a spreadsheet. It could have hundreds of records (rows) displayed. I want to enable the user to edit any one or any number of records and any fields, then click a save button to UPDATE the SQL table. I'd like to use stored procedures if possible. How is this done? Where do I start? thanks
3
10154
by: Adam | last post by:
Hey guys, I've decided to stop banging my head against the wall and just ask you guys for the answer. I can't seem to find it. I have a form in which I have multiple submit buttons; only, I'm using button tags, not input tags to do it. It seems that IE6 is treating all the button elements as being successful on submit. This is, to say the least, surprising since the Spec is pretty clear that it should.
3
2568
by: D. Shane Fowlkes | last post by:
Sorry for the length of this post. I have created a rather complex form which has a header/line item (parent and child records) structure. It's for an intranet. A screenshot can be seen here: http://www.drpt.virginia.gov/temp1.gif All the fields on this form have validation controls on them so they can not submit the form unless all fields are completed and some fall within a specified numeric range. When the form first is loaded,...
5
4343
by: ningjun.wang | last post by:
How can I submit a form to multiple web sites when user click the submit button? Something like the following: myform.action = url_of_server1; myform.submit(); myform.action = url_of_server2; myform.submit(); The above code only submit form to url_of_server1. The second submit is ignored. Is there any trick to make it works? For example is it
5
20017
by: Alex Maghen | last post by:
In ASPX 2.0 with MasterPages and all that, my entire page only has one actual <FORM>. But there are several different sections of the page that provide what are functionally separate forms with separate Submit buttons. In basic HTML, I can have multiple forms on a page and the browser knows that if any of the fields for Form A have the focus, then pressing ENTER will send a Click to the submit button for Form A. Same for Form B, etc. ...
5
14132
by: c676228 | last post by:
Hi everyone, my colleagues are thinking about have three insurance plans on one asp page: I simplify the plan as follow: text box:number of people plan1 plan2 plan3
1
2647
by: ll | last post by:
Hi all, I've inherited a site and am currently looking to redesign a page that displays a table of course curriculum, with each row representing a "Topic" of the curriculum. There is a courseID that exists throughout the site, identifying each course. Within each row of the aforementioned table, there are 4 columns, consisting of MainTopics, their associated SubTopics, uploaded LectureNotes for that MainTopic, and finally a DeleteRow...
6
7574
by: phpnewbie26 | last post by:
My current form has one multiple select drop down menu as well as few other drop down menus that are single select. Originally I had it so that the multiple select menu was first, but this created the problem that when I went to select the other drop down menus, the selections i made on the multiple select one would clear. Then I had tried putting the multiple select menu last so that the selections wouldn't clear but then after clicking the...
0
9669
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9515
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10207
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5431
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5559
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4110
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.