phpprogrammer.cn schrieb:
You can add your own validation method and apply that to your username field. Give this a try:is there a way use jquery.validate filter special characters?like some one want to input "*&^%" as username, is there a way to solve it?
$.validator.addMethod("username", function(value) { // blacklist *, %, $ and & return /^[^\*&\^%]+$/g.test(value); });That basically blacklists *, %, $ and &. [^...]+ specifies characters that are now allowed.
Jörn