several buttons in form - which one was clicked
| From: | Vahldieck, Mike | Date: | Tue, 11 Feb 2003 01:09:09 +0000 |
| Subject: | several buttons in form - which one was clicked | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-135143@lists.php.net to get a copy of this message | ||
Hi there,
I'm new to PHP, so maybe this Q makes me look rather stupid... never mind,
asking it anyway...
I want to have a form with several checkboxes and an OK button next to each
of them, to enable users to send data when checkbox has been changed..
I need to pass $i to know, which button has been clicked...
for ($i = 1; $i <= 30; $i++) {
echo "<INPUT TYPE=\"checkbox\" name=\"cbox$i\" checked>checkbox No.
$i";
echo "....";
echo "<FORM ACTION=\"anyfile.php?box=$i\" METHOD=\"POST\">";
echo "<INPUT TYPE=\"Submit\" NAME=\"OK$i\"
VALUE=\"OK\">";
echo "<br>";
}
?>
I always get anyfile.php?box=1 ... What am I doing wrong?
Better ways to do that?
Thanks for your help
greetings from Berlin/Germany
Mike