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

multiple forms submit ??

Status
Not open for further replies.

iza

Programmer
Apr 4, 2000
1,804
FR
is it possible to submit 2 (or more !!) forms at once ??<br><br>&nbsp;- i have very specific validation functions, actually, they expect a form to b passed as parameter (say, check_subform1(form1), check_subform2(form2) )<br>&nbsp;- that's why i have to have 2 forms in my page (form1 & form2)<br><br>&nbsp;i've tried both :<br>-------------------------------------<br>in the script part<br>function validate_all(){<br>&nbsp;if (check_subform1(form1)&&check_subform2(form2)) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;form1.submit();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;form2.submit();<br>&nbsp;}<br>}<br>in the htm part<br>&lt;form name=&quot;form1&quot; action=&quot;url.cfm&quot;&gt;<br>...<br>&lt;/form&gt;<br>&lt;form name=&quot;form2&quot; action=&quot;url.cfm&quot;&gt;<br>...<br>&lt;/form&gt;<br>&lt;form&gt;<br>&lt;input type=button onclick=&quot;javascript:validate_all()&quot;&gt;<br>&lt;/form&gt;<br><br>this submits only form2 (and, if in validate_all() i invert form1 and form2, it submits only form1 of course)<br>--------------------------------------------<br>and :<br>in the script part<br>function validate_all(){<br>&nbsp;if (check_subform1(form1)&&check_subform2(form2)) <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;la_form.submit();<br>}<br>in the htm part<br>&lt;form name=&quot;la_form&quot; action=&quot;url.cfm&quot;&gt;<br>&nbsp;&lt;form name=&quot;form1&quot;&gt;<br>&nbsp;...<br>&nbsp;&lt;/form&gt;<br>&nbsp;&lt;form name=&quot;form2&quot;&gt;<br>&nbsp;...<br>&nbsp;&lt;/form&gt;<br>&lt;input type=button onclick=&quot;javascript:validate_all()&quot;&gt;<br>&lt;/form&gt;<br><br>this actually doesn't find form1 (neither form2)<br>------------------------------------------------<br><br>any clue ?<br>could document.all.forms.forms[0].any_property work ?????<br><br><br><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top