Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Submitting multiple Forms

Status
Not open for further replies.

rumbler

Programmer
Jan 16, 2002
4
GB
Hi,

Is there a way of submitting more than one form( but using only one submit button). I've tried document.all.forms.submit() and also
document.forms.submit(), but neither do the trick.

Thanks in Advance.
 
hi rumbler,
I'm not completely sure about it, but if you want to submit all forms at once use this:

function submit_all() {
for (n=0; n<document.forms.length; n++)
document.forms[n].submit();
}

If you want to submit some particular forms (but not all of them), use this:
function submit_all() {
document.forms[1].sibmit();
document.forms[3].sibmit();
}

call this function from any button or link on your page:
<. . . onclick=&quot;submit_all()&quot;>

An off-topic issue:
don't use document.all structure as it's IE-only.

good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top