HTML multiple form submit but as one single request

What best I can do if I need to submit 2 forms at once but it has to go out as one single HTTP (post/get) request?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

as one POST ... so that means you want to submit the data from two forms as if it were a single form?  If this is correct, then you can copy the fields from from2 into corresponding hidden fields in form1 and then submit form1.  Let me know if you need help with this.
"from2" should be "form2"
combine both forms into one huge hidden master form

simple example

<form "aForm1">
<input type="text" name="num1" onkeyup="document.hiddenForm.num1.value = this.value">

<form "aForm2">
<input type="text" name="value1" onkeyup="document.hiddenForm.value1.value = this.value">

<button value="Submit" onclick="document.hiddenForm.submit()">

<form name="hiddenForm">
<input type="hidden" name="num1">
<input type="hidden" name="value1">
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

oops sorry kEk
nik_c_shahAuthor Commented:
Since one of the forms is in an IFRAME element, can I not copy it as an object and nest it within the form I can submit ? And the forms have very large select boxes, i want to avoid parsing them and storing in arrays etc. Also how do u copy form elements (and not their contents into hidden fields)?
Bustarooms:  no worries at all.

Nik:  It would be helpful to see your code, but in general do this in the main page (the one containing the IFRame)

function copyIFrameFormElements()
    var iFrameForm = self.frames["nameOfTheIFrame"].document.forms["nameOfTheIForm"];
    var mainForm = document.forms["nameOfTheMainForm"];

    // if it is a text box:
    mainForm.hiddenField1.value = iFrameForm.textField1.value;

   // if it is a SELECT:
   mainForm.hiddenField2.value = iFrameForm.selectField2.options[iFrameForm.selectField2.selectedIndex].value;
>>... copy it as an object and nest it within the form I can submit

the following demonstrates concatenating 2 forms in the same page.  You would simply have to modify one of the assignments to reflect your iframe -- frames.framename.document.getElementById('formID').innerHTML;

function doit(formObj)
  x = document.getElementById('b').innerHTML
  y = document.getElementById('a').innerHTML
  document.getElementById('a').innerHTML += x;
  z = document.getElementById('a').innerHTML


<form name="a" onsubmit='doit(this)'>
<textarea name='theResults' id='theResults' rows=10 cols=40 onfocus=this.blur()>1
<input type="submit">
<form name='b' id='b'>
<input type="text" value='abc'>


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nik_c_shahAuthor Commented:
Guyz thanks for all ur insight. Vincent ur trick of adding up the innerHTML and submitting is really cool. I shall settle in for that. Is there an Netscape equivalent to it?
  if you mean nn6+, it uses innnerHTML
  if you mean nn4.7, 99.9% percent sure don't think so.  NN4.7 layers are documents in and of themselves; so, while you would be able to access individual elements within the form with something like
you would then have the problem of concatenating it into the 'submit' form. Also, the div would have to be positioned absolutely -- another potential problem.  You would be better off filling hidden fields.

nik_c_shahAuthor Commented:
Further Update on error messages:

Exception loading servlet /nmsloader/test-tags.jsp stack:
java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo: method (Ljava/lang/String;ZZLjava/lang/String;)V not found
      at org.apache.jasper.compiler.TagLibraryInfoImpl.createAttribute(
      at org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(
      at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(
      at org.apache.jasper.compiler.TagLibraryInfoImpl.(
      at org.apache.jasper.compiler.JspParseEventListener.handleDirective(
      at org.apache.jasper.compiler.DelegatingListener.handleDirective(
      at org.apache.jasper.compiler.Parser$Directive.accept(
      at org.apache.jasper.compiler.Parser.parse(
      at org.apache.jasper.compiler.Parser.parse(
      at org.apache.jasper.compiler.Parser.parse(
      at org.apache.jasper.compiler.Compiler.compile(
      at com.netscape.server.http.servlet.NSServletEntity.load(
      at com.netscape.server.http.servlet.NSServletEntity.update(
      at com.netscape.server.http.servlet.NSServletRunner.Service(

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.