Closed haresh6x closed 2 years ago
The last option of the message
method accepts options so you can do:
{this.validator.message('title', this.state.title, 'required|regex:abcd', {messages: {regex: 'This is a custom message'})}
The last option of the
message
method accepts options so you can do:{this.validator.message('title', this.state.title, 'required|regex:abcd', {messages: {regex: 'This is a custom message'})}
Wow! Thanks alot. Suprised I didn't find it in documentation or might be i missed it.
Hi, according to the docs:
How do i customise the message? For example I have a regex in place that allows input starting with T followed by numbers. The validation is working but I want to give message like "the field-name must start with T followed by numbers." Currently the validation says "the field-name must match the required pattern"