Multiple Validators
Multiple Validators
Datagaard
Posts: 68Questions: 20Answers: 3
I want to be able to validate a numeric field that will allow a null value.
I can't seem to get the right combination of option settings.
Tried this:
Field::inst( 'CMBSCodes.MaxClaimAmount' )
->validator( 'Validate::empty',true)
->validator( 'Validate::numeric' )
But I receive an Error in the Editor, with no message when I leave the field which is null untouched.
Or have I misinterpreted the validation options manual!
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I think you just need:
Editor's PHP validators have a "common" validation and an empty check is part of that. The default is to allow a null value if it is optional.
Allan