正则表达式呀:http://www.993063.com/article/skill/044/411496541.htmhttp://msdn.microsoft.com/library/chs/default.asp?url=/library/CHS/jscript7/html/jsreconintroductiontoregularexpressions.asp

解决方案 »

  1.   

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head>
    <body>
    <form name="form1" method="post" action="" onSubmit="return check(document.form1.textfield.value);">
      <input type="text" name="textfield">
      <input type="submit" name="Submit" value="提交">
    </form>
     <SCRIPT LANGUAGE="JavaScript">
    function check(inputStr){
          iLength = inputStr.length
          for (i = 0; i < iLength; i++){
      var aaa=inputStr.charCodeAt(i);
            if ((64< aaa)&&  (aaa< 123 )){ 
                alert("Input error!");
                return false ;
               }
       }
         return true ;
    }
    </SCRIPT></body>
    </html>