J
Jeremy Langworthy
Hi
I have a dynamicly generated form (well the elements are at least)
that looks something like this:
while( not end of returned records):
<input name="plan_id[]" type="checkbox" id="" value="<?=
$row_plans->planid ?>">
<input name="num_of_pockets[<?= $row_plans->planid ?>]"
type="text" id="num_of_pockets[]" value="<?=
$row_plans->num_of_pockets ?>" size="5" >
endwhile;
Basically it loops thru the table and creates a row of fields in the
form that use the array identifiers '[]' so that I can loop thru them
with PHP when the page is submitted.
The key for each array element is the id of the row from the database.
So checkbox[] (with value "1") and cost[1] are on the same line in the
form. The next line may not necessarily have cost[2] in it, it may be
cost[3] or [4], depending the id from the database.
Is there some way I can loop thru these form elements in javascript?
Does Javascript store them in an array like PHP does?
Any help gladly appreciated.
I have a dynamicly generated form (well the elements are at least)
that looks something like this:
while( not end of returned records):
<input name="plan_id[]" type="checkbox" id="" value="<?=
$row_plans->planid ?>">
<input name="num_of_pockets[<?= $row_plans->planid ?>]"
type="text" id="num_of_pockets[]" value="<?=
$row_plans->num_of_pockets ?>" size="5" >
endwhile;
Basically it loops thru the table and creates a row of fields in the
form that use the array identifiers '[]' so that I can loop thru them
with PHP when the page is submitted.
The key for each array element is the id of the row from the database.
So checkbox[] (with value "1") and cost[1] are on the same line in the
form. The next line may not necessarily have cost[2] in it, it may be
cost[3] or [4], depending the id from the database.
Is there some way I can loop thru these form elements in javascript?
Does Javascript store them in an array like PHP does?
Any help gladly appreciated.