This is the code where i generating my table :
foreach($list_user as $temp){
$this->table->add_row(++$i,
$temp->ID_user,
$temp->nama,
$temp->email,
form_checkbox('selected[]', $temp->active),
anchor('user/update/'.$temp->ID_user, 'update', array('class'=>'update')).' '.
anchor('user/delete/'.$temp->ID_user, 'delete', array('class'=>'delete',
'onclick' => "return confirm('Apa Anda yakin mau menghapus data user $temp->nama?')"))
);
}
Now if i generate the $temp->active without checkbox it will give me the right value like 1 (active) or 0 (not active)
My question is : How to change the value of my checkbox so if the value is 1 it will be automatically checked and vice versa.
Thanks
Use the third parameter of the
form_checkbox()which is boolean: