Forgive me for my very bad English.
I have read many of the forum on the arrays and checkbox, but bash can not solve a simple task.
In my view:
<input name="test[1]" type="checkbox" value="1">
<input name="test[2]" type="checkbox" value="1">
<?=$this->validation->test_error; ?>
In my controller:
$rules['test'] = "callback_";
$this->validation->set_rules($rules);
$fields['test'] = '"test checkbox"';
$this->validation->set_fields($fields);
function test_check()
{
if(isset($_POST['test'])){
$this->validation->set_message('test_error', 'Checked!');
return TRUE;
}else{
$this->validation->set_message('test_error', 'Not Checked!');
return FALSE;
}
}
if ($this->validation->run() == FALSE){
...redisplay form...
This is the trouble place.
no message displayed.
}else{
...insert in db, redirect...
}
where I am wrong? or I am hopelessly stupid? ![]()
Thanks.
