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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

submitting two forms with one click

Status
Not open for further replies.

p3boy

Programmer
Nov 19, 2004
7
US
I am trying to submit two forms with one button click. The code is as follows:

document.theForm.submit();
document.theForm2.submit();

Only the last form submitted is processed. If I reverse the order, the same thing happens, i.e., the last form submitted gets processed. The first form submitted is ignored. Is it possible that only one form can be submitted at a time? In this case, the theForm is an email posting, and theForm2 is a fileUpload.
 
A submit button sends the information from one page to a second page as it changes to that page. To "submit" to 2 pages, you'd first have to open a second window and pass the information to that page in the URL, then do an actual submit to the second page.

Lee
 
I guess it would make more sense to put all the fields in the same form and do just one "submit". I now have two asp scripts that I am using for the "actions", one for email and one for uploading. These scripts were supplied by my ISP. The problem is I have no idea how to combine these. Do you know of anyplace I could get such script?
 
If you can't edit the ASPs, then you might consider putting both forms in individual frames or iframes. Then you can submit them both simultaneously from their wrapper.

If you CAN edit them, then I would think it's just a question of putting the code from one at the bottom of the other. A few minor edits later and they should be successfully combined.

I imagine that if you post the code, someone here can figure out the best way to combine them.

--Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top