$inputFilter->add(array(
'name' => 'nightCharges',
'required' => FALSE,
'filters' => array(
array('name' => 'Digits'),
),
'validators' => array(
array(
'name' => 'GreaterThan',
'options' => array(
'min' => 1,
'messages' => array(
\Zend\Validator\GreaterThan::NOT_GREATER => 'My message',
),
),
),
),
));
Above is my code snippet for validation in this case for 'check box'. If I set 'required' to "true" and submit empty form, it shows me the default 'Value is required and can't be empty' message and if I set 'required' to 'false' it does't show me any error at all. Even if I submit non digit value it doesn't show me actual error message. Where am I making mistake? Actually I was working on 'Please accept the terms & conditions' check box.