wanaka
|
Posted: 03/16/2004, 7:51 PM |
|
I am using codecharge studio to add a checkbox and add some custom code to update / delete those checked item. The strange thing is if three items are checked it can only delete the first one not three.
global $device;
$engineercheck = $device->engineer_list->Value;
foreach($engineercheck as $key=>$value) {
if($key=='Y')
{
$db = New clsDBeontap();
$SQL = "DELETE FROM device_owner WHERE owner_id=" . "'" . "$value" ."'";
$db->query($SQL);
unset ($db);
}
}
|
|
|
Nicole
Posts: 586
|
Posted: 03/17/2004, 1:35 AM |
|
Hello,
As I understand engineer_list is CheckBoxList on a form. If so than you're using incorrect way to retrieve its list of values as array. Try
$check = CCGetFromPost("CheckBoxList1", array());
instead of
$engineercheck = $device->engineer_list->Value;
BTW, you can check ManyToManycheckbox example (events code) from CCSExample pack solution for a code.
_________________
Regards,
Nicole |
|
|
fausto
|
Posted: 03/24/2004, 2:42 PM |
|
Hello,
Try:
$engineercheck = $device->engineer_list->GetValue();
to retrieve a component value instead of your line 2.
|
|
|
|