<input id="Text1" type="text" runat="server" maxlength="6" />我在前面的2位必须是大写字母A-Z,  后面的4位必须是数字,输入的字符必须满5位 不满5位也会报错,哪位高手能提供以下啊·谢谢啦

解决方案 »

  1.   

        window.onload=function(){
            document.getElementById("Text5").onblur=function(){
                var reg = /^[A-Z]{2}\d{3,4}$/;
                if(reg.test(this.value))
                    alert("yes");
                else
                    alert("no");
            }
        }
      

  2.   

    <head>
    <script type="text/javascript">
        window.onload=function(){
            document.getElementById("Text5").onblur=function(){
                var reg = /^[A-Z]{2}\d{3,4}$/;
                if(reg.test(this.value))
                    alert("yes");
                else
                    alert("no");
            }
        }
    </script>
    </head>