adding items on a input box and a checkbox.
| From: | Louie Miranda | Date: | Mon, 11 Apr 2005 02:26:30 +0000 |
| Subject: | adding items on a input box and a checkbox. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-212773@lists.php.net to get a copy of this message | ||
I am having difficulty thingking how can i both add a quantity on a item,
and at the same time detect if my clients did check the box.
Like this:
http://dev.axishift.com/php/qtybox/qtybox.html
Here's the code i did, on how to catch the checkbox:
### code ###
foreach ($_GET as $varname => $value)
$parameters[$varname] = $value;
if (empty($parameters["add"]))
{
die("Incorrect parameters");
exit;
}
foreach($parameters as $itemName => $itemValue)
{
if ($itemValue == "add") {
end;
} else {
$itemExists = "select count(*) from catchorders_pending where uniqueID =
'$itemValue'";
$itemExists_result = $dbData->getOne($itemExists);
if ($itemExists_result == 0) {
$insertData = $dbData->query("INSERT INTO catchorders_pending (uid,uniqueID)
values ('$uid','$itemValue')");
} else {
//print("exist: $itemValue");
}; // end if exist
}; // end if itemvalue
}; // end of foreach
### code ###
Is it possible to add a input box, where i can add ex: quantity of items and
at the same time they can check the box? is it possible on my code?
please help!.
--
Louie Miranda
http://www.axishift.com -- under development