I think there is something wrong with checkbox validation when I give array as $value. When I set my own custom validator function, class.Field.php returns this:
Warning (2): class.Field.php at 240 trim() expects parameter 1 to be string, array given
The problem is trim() is set around $this->getValues(), which won't work in this case, since value is array... there should be:
public function checkBoxReqValidator ($items)
{
if (!empty ($items) && is_array ($items)) {
if (sizeof ($items) >= 1) {
return true;
}
}
return "You have to select at least one option";
}
This alone gives me error I pasted before in class.Field.php, so I replaced it with (line 239):
which makes validator work, but when I click BACK no checkbox is checked... unless I only check ONE, when I check more, none is checked when hitting back.
Changed at 15 July 10 / 11:54
Okay, I'm an idiot :) I know why it doesn't check them all on BACK... so sorry.
But the problem about validators still exists unless I remove the trim() around the value. My fix in class.Field.php works for me. Do check this part about validating checkbox, when I add array as options.