<script>
function check(){
var newstr="";str=checkthis.checktext.value,max=str.length,addascii=0;addbig5=0,flag=true;
for(var i=0;i<max && flag<40;i++,flag=addascii+addbig5){var codes=str.charCodeAt(i);
if(codes>=65 && codes<=122){addascii++;}else{addbig5+=2;}newstr+=str.charAt(i);}
checkthis.checktext.value=newstr;transfer(newstr);}
function transfer(arg)
{alert("其餘超過字串已切除,送出資料為/n/n"+arg);}
</script>
===HTML===
<form name="checkthis">
<input type="text" name="checktext" size="40">
<input type="button" οnclick="check()" value="欄位控制檢查"><sup>(僅對中英文字檢查,勿填入其他字元)</sup>
</form>
function check(){
var newstr="";str=checkthis.checktext.value,max=str.length,addascii=0;addbig5=0,flag=true;
for(var i=0;i<max && flag<40;i++,flag=addascii+addbig5){var codes=str.charCodeAt(i);
if(codes>=65 && codes<=122){addascii++;}else{addbig5+=2;}newstr+=str.charAt(i);}
checkthis.checktext.value=newstr;transfer(newstr);}
function transfer(arg)
{alert("其餘超過字串已切除,送出資料為/n/n"+arg);}
</script>
===HTML===
<form name="checkthis">
<input type="text" name="checktext" size="40">
<input type="button" οnclick="check()" value="欄位控制檢查"><sup>(僅對中英文字檢查,勿填入其他字元)</sup>
</form>