Set_checkbox() is not working although all is set? I do non compulsory post validation and only trim it to get the value pushed for call_back... When I post the form and other validations are not met, it should go back to the form. When it does, is the checkbox not selected after post even if was checked before submit. What am I missing?
Form / View:
<input type="checkbox" class="hsnb" value="25.00" name="u" onclick="Calculate()" <?=set_checkbox('u', '25')?>>
The controller:
$this->load->helper('form');
$this->load->library('form_validation');
if($this->input->post('submit2')) {
$this->form_validation->set_rules('u', 'u', 'trim');
if ($this->form_validation->run() === false)
{
$this->load->view('form', $data);
}
else
{
$this->load->view('form', $data);
}
}