输入岁数必须是数字  数字必须在16到90范围....带输入数字的框框..谢谢大家了...

解决方案 »

  1.   

    没人吗...急啊...还有要通过xhmtl 1.0的验证....上次找了一个不能通过验证..说没有这个语句
      

  2.   

    <input type="text" name="num" onblur="test()"/>
    <script>
    function test(){
    var text=document.getElementById("num").value;
    text=parseInt(text);
    if(!(text<90&&text>16))  alert("please enter a right number again...");
    }
    </script>
      

  3.   

    也不行...是不是我代码错了还是我不会加进去....Your Age:<input type="text" name="Age" size="10"/> 我原来就直接用这个代码...现在换你的就直接把your age:后面的都删掉换你的了...
      

  4.   

    </script>
    <input type="text" id="num" onmouseout="test()"/>
    <script>
    function test(){
    var text=document.getElementById("num").value;
    console.log(text);
    text=parseInt(text);
    console.log(text==45);
    if(!(text<90&&text>16)) alert("please enter a right number again...");
    else return;
    }
    </script>不好意思,刚不小心写成了id,现在改过来了
      

  5.   


    </script>
    <input type="text" id="num" onmouseout="test()"/>
    <script>
    function test(){
    var text=document.getElementById("num").value;
    text=parseInt(text);
    if(!(text<90&&text>16)) alert("please enter a right number again...");
    else return;
    }
    </script>
      

  6.   

    结了..谢谢  
    还有一个问题..你给我写的那个代码...if(!(text<=90&&text>=16)) 这个部分...在网页能用..可是就不能通过xhtml1.0验证 如果把<>和&& 换成全角的话就能通过..可是在网页里不能用..这是什么情况?