473,387 Members | 1,495 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,387 software developers and data experts.

Multiple form submit using single button

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.action="formsubmit2.php"
document.f2.submit();
alert('Form2 Submitted');
}

function form1Submit() {
document.f1.action="formsubmit2.php"
document.f1.submit();
document.getElementById("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="submitAllForm()" />
</body>

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

Thanks.
Dec 20 '07 #1
1 2455
rpnew
188 100+
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.action="formsubmit2.php"
document.f2.submit();
alert('Form2 Submitted');
}

function form1Submit() {
document.f1.action="formsubmit2.php"
document.f1.submit();
document.getElementById("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="submitAllForm()" />
</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
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...
4
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...
3
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...
3
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: ...
5
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;...
5
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...
5
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
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...
6
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...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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:
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...
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
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...

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.