对不起
<input type="text" name="textfield" maxlength="2">
<script language=vbscript>
sub haha()
if lenB(textfield.value) <>2then
alert "重新输入"
……
end if
end sub
</script>
<input type="text" name="textfield" maxlength="2">
<script language=vbscript>
sub haha()
if (textfield.value) <>2then
alert "重新输入"
……
end if
end sub
</script>