jurassix / react-validation-mixin

Simple validation mixin (HoC) for React.
MIT License
282 stars 38 forks source link

Validation property preprocessing #50

Closed Volodymyr128 closed 9 years ago

Volodymyr128 commented 9 years ago

Sounds like an anti-pattern, but I don't see another way. I have lots of fields which may contain space characters (i.e. e-mail field). I validate e-mail with Joi.string().email().min(5).max(50).required(), but I want the next e-mail be valid " some-email@gmail.com ", and just trim when send to the server

jurassix commented 9 years ago

Do your pre-processing in the getValidatorData API. You can easily preprocess your form data here before validation.

Volodymyr128 commented 9 years ago

Thank you !!!!!