I want to validate a text box to ensure only characters and Unicode characters can be added to it. For example, the following would be valid:
Gräfelfing
Gießen
München
But these should be invalid:
Gräfelfing123
Gießen!@#$
München123#@#
I know how to validate for characters using validator method:
jQuery.validator.addMethod("lettersonly", function(value, element) {
return this.optional(element) || /^[a-zA-Z]+$/i.test(jQuery.trim(value));
}, "Letters only please");
But how can I add Unicode character validation to this? Please help, thanks in advance.
* UPDATE *
I tried a solution with the help of this question - Regular expression to match non-English characters.
But it is not working:
jQuery.validator.addMethod("lettersonly", function(value, element) {
return this.optional(element) || /^[a-zA-Z\u0000-\u0080]+$/i.test(jQuery.trim(value));
}, "Letters only please");