Answer the question
In order to leave comments, you need to log in
How to implement password comparison with Formsy-React?
This is my first time using a form library, and here's the question I had: How to check for a match between the values of two inputs with passwords and pass an error to prop.validationErrors in the corresponding FormsyInput instances (there are more fields in the form)?
<FormsyInput
name="password.enter"
type="password"
validations="minLength:6"
required
/>
<FormsyInput
name="password.confirm"
type="password"
validations="minLength:6"
required
/>
Answer the question
In order to leave comments, you need to log in
Here is an example that should help you:
<MyInput name="number" validations={{
myCustomIsFiveValidation: function (values, value) {
values; // Вот тут, по идее, есть значения других полей
value; // 5
return 5 === value ? true : 'No five'; // You can return an error
}
}}/>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question