I have a checked-box list in my view where I am getting values loaded from database.
<input type="checkbox" id="CheckBoxAdmin" name="CheckBoxAdmin" <?php echo $Admin; ?> />Admin
<input type="checkbox" id="CheckBoxCreateUser" name="CheckBoxCreateUser" <?php echo $CreateUser; ?> />Create User
I am passing value to this through my controller.
$this->load->view('edituserview', $data);
$data contains an array of the user privileges.
for($i=0;$i<$max;$i++)
{
if( $pieces[$i]=="Admin" )
{
$data['Admin']="checked";
}
else
{
$data['Admin']="";
}
if( $pieces[$i]== "Create User")
{
$data["CreateUser"]="checked";
}
else
{
$data["CreateUser"]="";
}
}
$this->load->view('edituserview', $data);
But the problem is,I can't see the correct status of checked box (whether it is checked or not) when I echo $Admin or $CreateUser. I want to pass the value as it is in controller, to view.
Any help will be highly appreciated.