不能输入汉字:
<INPUT onpaste="return false;" 
      style="IME-MODE: disabled; WIDTH: 400px" 
      value="I only accept English input! Thanks for corporation!" 
      name=textfield>

解决方案 »

  1.   

    <input name="txt"><input type="submit" onClick="alert(/[^ -~]/.test(txt.value)?'有中文':'没有中文')">
      

  2.   

    把  onpaste="return false;"  改为  onpaste="return true;" 就成了
      

  3.   

    改为  onpaste="return true 中文又能粘进去了,还是没办法避免中文塔克拉玛干---胡杨林 这个倒是能判断有没有中文,只是在点查询按纽的时候他会提示有无中文,如果发布者不去点这个按纽,直接点提交按纽,不还是可以发布进去吗,能不能把这个判断定义成一个函数test(),在表单里判断呢<form name="form1" method="post" action=""  onSubmit="return test()">
      

  4.   

    <form name="form1" method="post" action="" onSubmit="return (/[^ -~]/.test(txt.value)?false:true)">
      

  5.   

    嗯,可以了 ,谢谢 ygjwjj(塔克拉玛干---胡杨林) 哦