可以寫一個funtion
String.prototype.len=function()
{ return this.replace(/[^\x00-\xff]/g,"rr").length; }
正規化判斷有幾個字元
例:
<script>
function check(){
if ($("#MonthDesc").val().len() >72) {
alert("ㄅㄧl請勿超過36個字。");
return false;
}}
{ return this.replace(/[^\x00-\xff]/g,"rr").length; }
</script>