Checkboxes, forms, and associated values..
| From: | Chad Day | Date: | Tue, 22 Aug 2000 13:21:35 +0000 |
| Subject: | Checkboxes, forms, and associated values.. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-12934@lists.php.net to get a copy of this message | ||
I hate to ask this question, but after searching my books and the mailing
list, I haven't been able to find an answer.
I have a form that is set up like:
echo "<td><input type=\"text\" size=\"40\"
name=\"DESCRIPTION[]\"
value=\"$row[DESCRIPTION]\"></td>";
echo "<td><input type=\"text\" name=\"PRICE[]\"
value=\"$row[PRICE]\"></td>";
echo "<td><input type=\"checkbox\" name=\"ORDER[]\"
value=\"$row[ID]\"></td>";
echo "<input type=\"hidden\" name=\"OPTIONS[]\"
value=\"$OPTIONS\">";
on the following page, I'm trying to show the results:
for ($x = 0; $x < $count; $x++) {
echo "<tr>";
echo "<td><input type=\"text\" name=\"ORDER\"
value=\"$ORDER[$x]\"
size=\"8\"></td>";
echo "<td><input type=\"text\" name=\"PART\"
value=\"$PARTCOLUMN[$x]\" size=\"21\"></td>";
echo "<td><input type=\"text\" name=\"DESCRIPTION\"
value=\"$DESCRIPTION[$x]\" size=\"30\"></td>";
echo "<td><input type=\"text\" name=\"QUANTITY\"
size=\"4\"></td>";
echo "<td><input type=\"text\" name=\"PRICE\"
size=\"8\"
value=\"$PRICE[$x]\"></td>";
echo "<td><input type=\"text\" name=\"DOCKDATE\"
size=\"10\"></td>";
echo "</tr>";
}
(where count is the size of the array)..
I only want to show the array elements associated with the checkbox in that
row. If checkboxes 1 and 3 are checked, I want to show the data from the
form in the same "row" as that on checkbox. The problem is if I select box
1 and 3, it prints out rows 1 and 2 of the array.. it's putting everything
into the array regardless of if the checkbox is on, and I understand why
it's doing that.. I just don't know how to best going about either putting
into the array only the values I need (ones with checkbox on), or pulling
out the values that are only associated with the checkbox being on.
Thanks,
Chad Day
Beach Associates
When I speak german... I think german in my head... but like...Do skript
kiddies see a w40l3 8uncha 1's and 0's and 3's and 4's and 7's in their
h34d'5 w43n t43y R +a1k1n6 ? -- SirStanley