You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am attempting to validate a form where I have firstName, lastName and companyName fields. I want to validate that at least one of them is entered. I am using validatorjs as my validation engine.
It looks like required_without_all is working the way I expect, except that the message I am getting isn't quite right. The error message text has the field names rather than labels for the other fields.
Expected result:
"The First Name field is required when Last Name, Company Name are empty."
Actual result:
"The First Name field is required when lastName, companyName are empty."
Is there any way to get the error message to display the labels?
Note I am using separated definition since I have nested fields in my real world example.
Looks like it may be an issue with the validatorjs library.
This bug raised against the library has similar problem but with the required_if rule. When that gets fixed I will check if it's working ok. mikeerickson/validatorjs#232
I am attempting to validate a form where I have firstName, lastName and companyName fields. I want to validate that at least one of them is entered. I am using validatorjs as my validation engine.
It looks like required_without_all is working the way I expect, except that the message I am getting isn't quite right. The error message text has the field names rather than labels for the other fields.
Expected result:
"The First Name field is required when Last Name, Company Name are empty."
Actual result:
"The First Name field is required when lastName, companyName are empty."
Is there any way to get the error message to display the labels?
Note I am using separated definition since I have nested fields in my real world example.
Config:
Versions:
validatorjs: 3.14.2
mobx-react-form: 1.32.3
The text was updated successfully, but these errors were encountered: