[solved]html forms array and javascript array
Posted: Thu Feb 09, 2006 1:27 pm
I have a simple form that generated another set of forms depending on how customers are entered.
First form: how many customer?
Second file: If the answer is 2, it generated 2 forms with exactly the same fields. It's stored in an array.
My question is how to have javascript read the values in that array. Thanks!!
Here's a sample of the 2nd file.
First form: how many customer?
Second file: If the answer is 2, it generated 2 forms with exactly the same fields. It's stored in an array.
My question is how to have javascript read the values in that array. Thanks!!
Here's a sample of the 2nd file.
Code: Select all
echo "<form name='totalcomp' action='average2.php' method='POST'>";
for ($i=0; $i<$number; $i++)
{
?>
<fieldset style="width:300px; height:150px"><legend>Compute Average</legend>
<div id = "box2">
<table border = "0">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Number 1:</td>
<td><input type="text" name="num1[]" /></td>
</tr>
<tr>
<td>Number 2:</td>
<td><input type="text" name="num2[]" /></td>
</tr>
<tr>
<td>Total:</td>
<td><input type="text" name="total[]" onBlur = "mytest()"/></td>
</tr>
</table>
</div>
</fieldset>
<?}?>
<tr>
<td><input type="submit" name = "submit" value="submit" /></td>
</tr>
</form>