Sets or replaces the current message handler for the specified rule.
You will get a message created with the handler if includeMessages
option is true
Name | Description |
---|---|
rule:string |
The rule to set the message handler for. E.g "required|image"
|
createMessage:function |
A function which handles message creation. E.g: fieldData => `${fieldData.name} is required` Where fieldData will be in the form of: {// E.g { key: 'username' validation: 'between:3,10', value: 'nik-m2' } key: [fieldName], validation: [rules], value: [value], // Will include any extra properties on field that are // given to validateForm. E.g "label" key } |