<input onblur="mm(this)"><script>
var aa = [10,11,12,13,14];
function mm(e)
{
   var s = e.value;
   if (s == "") return;
   for (i in aa)
      if (aa[i] == s) return;
   e.value="";
   e.focus();
}
</script>

解决方案 »

  1.   

    <script>
    var aaa=new Array("111","222","333");
    function check(v){
    for(i=0;i<aaa.length;i++){
    if(aaa[i]==v.value)return;
    }
    v.value=""
    }
    </script><input type="text" name="textid">
    <input type="button" name="But1" value="check" onClick="check(textid)"">
      

  2.   

    那你应当使用select下拉列表框,不应该用text框呀。
    实在要这样做,可以尝试:
    在window的timer过程中不断察看比较输入的值
      

  3.   

    <input type="button" name="But1" value="check" onClick="check(textid)">
    对不起我最后句多加了个"
      

  4.   

    小弟在解决这问题时不断报错:
    行1661行(我没有此行)
    字符4
    错误:被呼叫方(服务器【不是服务器应用程序】)不可用并已消失。所有连接均无效。没有执行呼叫。
    代码:0
    ------
    是什么意思,我没干么子呀!我只是
    <input  onblur=  "mm(this)  "  onclick='window.open(xxx.asp,this.value)'> 在失去焦点时检验,在单击时打开另一个窗口,传递thisvalue参数。在xxx.asp中以this.value检索数据库,如果没有就关闭窗口。xxx.asp中用<OBJECT  id=closes  type="application/x-oleobject"  classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" >closes.Click()来关闭窗口。由于这错误也管不了,大家帮帮看看!
      

  5.   

    <input  onblur="mm(this)" onclick='window.open("xxx.asp\?msg="+ this.value)'>
    你的 window.open 参数写错了.
      

  6.   

    没有呀<input type="text" name="ccode1" size="13" class="kuang" onblur="mm(this)" onKeyUp="this.value=this.value.replace(/[^0-9]/,'');" onmouseover="output('1')" onclick="openWindowkm21('inputgeren.asp',350,300,'1','ccode1')" ondblclick="openWindowkm('kjkmchoose.asp',550,600,'ccode1')" >
      

  7.   

    来一个不用循环的方法:
    <input onblur="mm(this)"><script>
    var a=new Array();
    a["a"]=true;
    a["b"]=true;
    a["1"]=true;function mm(e)
    {
        if(e.value==""||eval("a['"+e.value+"']")) return false;
    e.value="";
        e.focus();
    }
    </script>
      

  8.   

    Sorry:以上不用循环的方法里,输入值里有单引号时会报错