반응형
function chkStrLength(obj){
var strValue = obj.value;
var strLen = strValue.length;
var totalByte = 0;
var len = 0;
var oneChar = "";
var str2 = "";
for (var i = 0; i < strLen; i++) {
oneChar = strValue.charAt(i);
if (escape(oneChar).length > 4) {
totalByte += 2;
} else {
totalByte++;
}
len = i + 1;
}
return totalByte;
}
반응형