Hi I am trying to submit multiple form using javascript and I am not sure if it is even possible.
Here is an example of what I am trying:
Code:
<form method='POST' name='tForm0' action='cart.php'><input type="checkbox" name="optn0" value="1"><input type='text' name='quant' size='3' value=''><input type='hidden' name='id' value='paint'><input type='hidden' name='mode' value='add'>Blue<br /><!--<input type="image" src="images/buy.gif" border="0">--></form>
<form method='POST' name='tForm1' action='cart.php'><input type="checkbox" name="optn1" value="2"><input type='text' name='quant' size='3' value=''><input type='hidden' name='id' value='paint'><input type='hidden' name='mode' value='add'>Red<br /><!--<input type="image" src="images/buy.gif" border="0">--></form>
<form method='POST' name='tForm2' action='cart.php'><input type="checkbox" name="optn2" value="3"><input type='text' name='quant' size='3' value=''><input type='hidden' name='id' value='paint'><input type='hidden' name='mode' value='add'>Green<br /><!--<input type="image" src="images/buy.gif" border="0">--></form>
<form method='POST' name='tForm3' action='cart.php'><input type="checkbox" name="optn3" value="4"><input type='text' name='quant' size='3' value=''><input type='hidden' name='id' value='paint'><input type='hidden' name='mode' value='add'>Yellow<br /><!--<input type="image" src="images/buy.gif" border="0">--></form>
<form method='POST' name='tForm4' action='cart.php'><input type="checkbox" name="optn4" value="42"><input type='text' name='quant' size='3' value=''><input type='hidden' name='id' value='paint'><input type='hidden' name='mode' value='add'>Purple<br /><!--<input type="image" src="images/buy.gif" border="0">--></form>
<form method='POST' name='tForm5' action='cart.php'><input type="checkbox" name="optn5" value="43"><input type='text' name='quant' size='3' value=''><input type='hidden' name='id' value='paint'><input type='hidden' name='mode' value='add'>Lime<br /><!--<input type="image" src="images/buy.gif" border="0">--></form>
<form method='POST' name='tForm6' action='cart.php'><input type="checkbox" name="optn6" value="44"><input type='text' name='quant' size='3' value=''><input type='hidden' name='id' value='paint'><input type='hidden' name='mode' value='add'>Lylac<br /><!--<input type="image" src="images/buy.gif" border="0">--></form>
<form method='POST' name='tForm7' action='cart.php'><input type="checkbox" name="optn7" value="45"><input type='text' name='quant' size='3' value=''><input type='hidden' name='id' value='paint'><input type='hidden' name='mode' value='add'>Maroon<br /><!--<input type="image" src="images/buy.gif" border="0">--></form>
<form method='POST' name='tForm8' action='cart.php'><input type="checkbox" name="optn8" value="46"><input type='text' name='quant' size='3' value=''><input type='hidden' name='id' value='paint'><input type='hidden' name='mode' value='add'>Teal<br /><!--<input type="image" src="images/buy.gif" border="0">--></form>
<form method='POST' name='tForm9' action='cart.php'><input type="checkbox" name="optn9" value="47"><input type='text' name='quant' size='3' value=''><input type='hidden' name='id' value='paint'><input type='hidden' name='mode' value='add'>Admiral Blue<br /><!--<input type="image" src="images/buy.gif" border="0">--></form>
<form method='POST' name='tForm10' action='cart.php'><input type="checkbox" name="optn10" value="48"><input type='text' name='quant' size='3' value=''><input type='hidden' name='id' value='paint'><input type='hidden' name='mode' value='add'>Antique Gold Deep<br /><!--<input type="image" src="images/buy.gif" border="0">--></form>
<form method='POST' name='tForm11' action='cart.php'><input type="checkbox" name="optn11" value="49"><input type='text' name='quant' size='3' value=''><input type='hidden' name='id' value='paint'><input type='hidden' name='mode' value='add'>Antique White<br /><!--<input type="image" src="images/buy.gif" border="0">--></form>
<form method='POST' name='tForm12' action='cart.php'><input type="checkbox" name="optn12" value="50"><input type='text' name='quant' size='3' value=''><input type='hidden' name='id' value='paint'><input type='hidden' name='mode' value='add'>Base Flesh<br /><!--<input type="image" src="images/buy.gif" border="0">--></form>
<input type="submit" name="submitted" value="Submit form" onclick="return formHandler()"></td></tr></table><script language="javascript">
<!-- //
function formHandler(){
document.tform0.submit();
document.tform1.submit();
document.tform2.submit();
document.tform3.submit();
document.tform4.submit();
document.tform5.submit();
document.tform6.submit();
document.tform7.submit();
document.tform8.submit();
document.tform9.submit();
document.tform10.submit();
document.tform11.submit();
document.tform12.submit();
}
//-->
</script>


and I keep getting this error:
document.tform0 is null or not an object.