<SCRIPT LANGUAGE="JavaScript">
<!--
function a()
{
var totallength=0;
for (var i=0;i<document.forma.sUserName.value.length;i++)
{
var str=document.forma.sUserName.value;
var intCode=str.charCodeAt(i);
if (intCode>=0 && intCode<=128) {//continue;
totallength=totallength+1;
}
else {
totallength=totallength+2;
}
} //end for
alert(totallength);
if (totallength<3 || totallength>20)
{
document.forma.sUserName.select();
alert("用户名必须是3-20个字符!请重新输入。");
return false;
}
return true;
}
//-->
</SCRIPT>