Newbie : Help with check boxes
| From: | Mujahid Wazir | Date: | Wed, 27 Dec 2000 10:18:48 +0000 |
| Subject: | Newbie : Help with check boxes | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-4672@lists.php.net to get a copy of this message | ||
Hi,
I am building a form and creating a few checkboxes dynamically
Now when the user clicks on submit, I need to save details.
However some of these checkboxes may remain unchecked.
I name these check boxes as chk1, chk2 and so on and assign them values from
the db.
On the Submitted page I get errors of undefined variable.
How do I access only the check boxes that are checked ?
Here is some psedo code
for (i = 0, i < count of chk, i ++ ) {
$name = "chk" + $i;
if $$name is checked {
echo $$name;
}
}
I guess I dont know the exact syntax comming in the IF condition. Thats
where I would need to find out if a particular chech box has been checked or
not
Thanks
Regards
-Mujahid