[eluser]chadwhitaker[/eluser]
I have found that if you are running the Form Validation library if will prevent set_checkbox() and set_radio() functions from working.
Use the following controller to test my theory.
First run it as is, and test that the check box state is saved when submitting the form.
Then uncomment out "$this->load->library('form_validation');" and test it again, you will see that the checkbox state will not be remembered.
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Test extends CI_Controller {
public function __construct()
{
parent::__construct();
}
function index()
{
//$this->load->library('form_validation');
$this->load->helper('form');
echo form_open();
echo '<input type="checkbox" name="tester" value="hello world" id="tester" '.set_checkbox('tester', 'hello world').'/>';
echo form_submit('go', 'Give it a test!');
echo form_close();
}
}