[eluser]chicca[/eluser]
Sorry, but i need help again.
I have a view for the maintenance of a db table.
I inserted a new column with checkbox to know which row/rows i have to update or delete.
So I have this in the view
Code:
<tbody>
<?php foreach($aziende as $azienda): ?>
<tr>
<td>
<?php echo form_checkbox("aziendasel[]", $azienda->idAzienda, FALSE); ?>
</td>
<?php foreach($fields as $field_name => $field_display): ?>
<td>
<?php echo $azienda->$field_name; ?>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
and this in the controller's function for updating row (in if block i put these lines to test)
Code:
$aziendasel = $this->input->post('aziendasel');
if (count($aziendasel) == 1)
{
echo 'count: ' . "'" . count($aziendasel) . "'";
echo 'contenuto array: ' . "'" . $aziendasel[0] . "'";
}
If i check 0, 1 or more checkboxes, i always get the same result, that is count is 1 and $aziendasel[0] is ''.
What did i wrong?
Thanks in advance