Hello everyone,
I have the following problem:
I am populating a table row with a textarea where people can write comments to product orders.
$output[] = '<td align="center" width="100"><textarea name="specifics'.$id.'" value="'.specifics.'" cols="35" rows="5"></textarea></td>';
Here is the function "update" where the cart should be updated with the new comments and it should populate the rows with new comments in the textareas.
At the moment it populates the rows perfect BUT if I try to add a comment to the textarea and submit the form it doesen't return the rows anymore.
// Function update
case 'update':
if ($cart2) {
$newcart = '';
foreach ($_POST as $key=>$value) {
if (stristr($key,'specifics')) {
$id = str_replace('specifics','',$key);
$items = ($newcart != '') ? explode(',',$newcart) : explode(',',$cart2);
$newcart = '';
foreach ($items as $item) {
if ($id != $item) {
if ($newcart != '') {
$newcart .= ','.$item;
} else {
$newcart = $item;
}
}
}
for ($i=1;$i<=$value;$i++) {
if ($newcart != '') {
$newcart .= ','.$id;
} else {
$newcart = $id;
}
}
}
}
}
$cart2 = $newcart;
break;
Any help would be appreciated !