react-native-form-validator icon indicating copy to clipboard operation
react-native-form-validator copied to clipboard

how to add custom validators

Open iamhaaamed opened this issue 7 years ago • 3 comments

Hi, How can I add custom validators to react-native-form-validator?

iamhaaamed avatar Jul 27 '18 12:07 iamhaaamed

[2] How can I add custom validators to react-native-form-validator?

vocampos avatar Mar 11 '19 22:03 vocampos

Easy way it to extend the validate function and add the checks yourself and then add the errors:

this.messages['en']['my_error_name'] = 'field {0} had my error with {1}'
this._addError('some_field', 'my_error','data')

wodka avatar Apr 05 '19 18:04 wodka

first of - don't ping people to provide you with examples for your work. second - go through the code and look at the validator function

wodka avatar Mar 13 '20 09:03 wodka