Help with Custom Validation Message for "stringNotEqualToField" #3934
Answered
by
thetutlage
Omkaragrawal
asked this question in
Help
-
Hey Everyone, Please help Rule: firstName: schema.string({ trim: true }, [
rules.name({ maxLength: 20 }),
rules.alpha(),
rules.stringNotEqualToField({
fieldToCompare: 'lastName',
}),
]), Validation Message1: {
'firstName.stringNotEqualToField': '{{ field }} cannot be equal to {{ options.otherFieldName }}',
} Validation Message2: {
'firstName.stringNotEqualToField': '{{ field }}',
} Validation Message3: {
'firstName.stringNotEqualToField': 'First name cannot be equal to Last Name,
} I am unable to customise the bellow message in all the above 3 ways (when tried individually) Received message:
|
Beta Was this translation helpful? Give feedback.
Answered by
thetutlage
Oct 14, 2022
Replies: 1 comment 3 replies
-
It seems like |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
thetutlage
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems like
stringNotEqualToField
is a custom rule. Can you share the implementation of the rule?