I have a form with multiple replication of fields for each entry pulled from a database. I have assigned a name to each form input with the records ID on the end.
i.e.
querying my database of people to get a list of names i create this form to be able to assign additional info to each person:
john --> enter age here [ ] enter weight here [ ]
mark --> enter age here [ ] enter weight here [ ]
paul --> enter age here [ ] enter weight here [ ]
etc etc
I assign to the two input fields the names age and weight followed by the persons record id
hence
age_01 weight_01
age_02 weight_02
age_03 weight_03
No problems so far, this is working fine.
In my script to then process the information from this form I am looping through the ID's extraced from the database and refering to the names+id number. This is where I am having a problem, I am not sure on the exact scripting to use to refer to the entries on the form, I guess it should be something like this:
for($ID=1;$ID<=3;$ID++) {
//i want to put a line here to make sure the form element exists
if($POST[age$ID]){
do something here;
}
}
Can anybody correct this for me, I have tried infinate ways of it working but can not get it right