Closed Gus19 closed 4 years ago
Hey, @Gus19. Thanks for reaching out.
I'm afraid targeting fields based on their field group is not supported when providing validation messages. The validation messages object supports three root-level keys (selectors):
name
type
general
These are described in the Validation messages section of the documentation.
If you wish to have a unique validation message for a field based on its field group, I suggest you provide a custom message resolve function and decide on the validation message based on props:
const validationMessages = {
name: {
first: {
invalid({ fieldProps }) {
// Look the properties of `fieldProps` and return conditional error messages.
}
}
}
}
Thanks for your response. I will continue to work with name for specifics messages :)
Hello,
I have a rules validation with a "fieldGroup" who is working fine, and I want to add a specific message validation.
I tried the same pattern as the rule, but it's not working ? I don't find the information into the documentation, this is not supported ?
Here is my code :
Thanks for the help ! :)