<script>
function chkit(theform){
if(theform.T1.value.match(/[^a-zA-Z]/g,'')!=null||theform.T1.value.length==0){
alert("输入为空或非字母!");
return false;
}
}
</script><form method="POST" action="" onsubmit="return chkit(this)" name="form1">
<input type="text" name="T1">
<input type="submit" value="提交" name="submit">
</form>昏,100分。接了先
function chkit(theform){
if(theform.T1.value.match(/[^a-zA-Z]/g,'')!=null||theform.T1.value.length==0){
alert("输入为空或非字母!");
return false;
}
}
</script><form method="POST" action="" onsubmit="return chkit(this)" name="form1">
<input type="text" name="T1">
<input type="submit" value="提交" name="submit">
</form>昏,100分。接了先
<HEAD>
<TITLE> New Document </TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
function checkKey() {
var keyCode = window.event.keyCode;
if((keyCode >= 65 && keyCode <= 90) || (keyCode >= 97 && keyCode <= 122)) {
} else {
return false;
}
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<FORM METHOD=POST ACTION="">
<INPUT TYPE="text" NAME="" onKeypress="return checkKey();">
</FORM>
</BODY>
</HTML>
function chkit(theform){
if(!/^[a-zA-Z]+$/.test(theform.T1.value)){
alert("输入为空或非字母!");
return false;
}
}
</script><form method="POST" action="" onsubmit="return chkit(this)" name="form1">
<input type="text" name="T1">
<input type="submit" value="提交" name="submit">
</form>
chCode = ch.charCodeAt(0);
if (((chCode>=97)&&(chCode<=122)) || ((chCode>=65)&&(chCode<=90)) || ((chCode>=48)&&(chCode<=57)) || chCode>127) {
return true;
} else {
return false;
}
}
function check(objValue){
if(!objValue.match(/^[A-Za-z]$/))
alert("请输入字母!");
}
</script>