jc_gmk
11-23-2007, 02:16 PM
I have a form that when it is submitted it displays an alert box
I want that alert box to display the value of the fields that were submitted
e.g.
<form action="somepage.php" name="orderqty" onsubmit="alert('you entered ' + orderqty.qty.value + '!')">
<input type="text" name="qty" />
<input type="submit" value="submit" />
</form>
This works fine, however the form that I am submitiing has multiple input boxes with the same name
e.g.
<input type="text" name="qty[]" />
<input type="text" name="qty[]" />
<input type="text" name="qty[]" />
<input type="text" name="qty[]" />
<input type="text" name="qty[]" />
<input type="text" name="qty[]" />
Is there anyway I can get the alert function to read the values of all the qty[] input fiels added together?
I want that alert box to display the value of the fields that were submitted
e.g.
<form action="somepage.php" name="orderqty" onsubmit="alert('you entered ' + orderqty.qty.value + '!')">
<input type="text" name="qty" />
<input type="submit" value="submit" />
</form>
This works fine, however the form that I am submitiing has multiple input boxes with the same name
e.g.
<input type="text" name="qty[]" />
<input type="text" name="qty[]" />
<input type="text" name="qty[]" />
<input type="text" name="qty[]" />
<input type="text" name="qty[]" />
<input type="text" name="qty[]" />
Is there anyway I can get the alert function to read the values of all the qty[] input fiels added together?