I want the maxlength validation of jQuery validate to display an error message like the following:
“Please enter no more than {0} characters. You’ve currently entered {1} characters.”
Where {1} is a placeholder for the actual amount.
What’s the best way to do this?
I don’t think there is a simple way to do that but I found a workaround for you. I guess you could write your own validator for that field but this may be simpler.
Start by changing the default message for
maxlengtherrors:Keep the validation as usual, but add this function:
Here’s the working demo for you.