String.prototype.len = function() { return this.replace(/[^\x00-\xff]/g, "xx").length; } 放到你的 <Script></script>当中去,然后你要判断长度的那里 就这么用alert($("#文本框id").val().len()); 就行了
js判断中文字符长度
原文:http://www.cnblogs.com/jassy/p/6747825.html