仿163注冊提示

字號:


    <html>
    <head>
    <title>仿163注冊提示顯示-網(wǎng)站制作學(xué)習(xí)網(wǎng)</title>
    <script language=javascript>
    var forasp = new object;
    forasp.f = function(obj,h)//obj是檢測的text文本框,h是自定義要顯示提示層距頂部的高度差,可以自行調(diào)節(jié)。
    {var t = document.getelementbyid(forasp_cn);
    t.style.top = 12 + h +px;
    t.innerhtml=obj.title;//將顯示的title放到層里面
    t.style.display=;
    }
    forasp.cl = function(obj)
    {
    var t = document.getelementbyid(forasp_cn);
    if (obj.value.replace(/[^\x00-\xff]/g,**).length > obj.l);//將中文替換為兩個字符
    {alert(obj.title+長度過長!);obj.value=;obj.focus();}
    t.style.display=none;
    }
    </script>
    </head>
    <body>
    <p><input type=text size = 25 onfocus=forasp.f(this,0); onblur=forasp.cl(this) l=10 title=請輸入用戶名><br><!--l表示內(nèi)容字符的長度,title是顯示的內(nèi)容-->
    <input type=text size = 25 onfocus=forasp.f(this,22);  onblur=forasp.cl(this) l=10 title=網(wǎng)站制作學(xué)習(xí)網(wǎng)><br>
    <input type=text size = 25 onfocus=forasp.f(this,45);  onblur=forasp.cl(this) l=10 title=要求的寬><br>
    <input type=text size = 25 onfocus=forasp.f(this,68);  onblur=forasp.cl(this) l=10 title=要求的高><br>
    <input type=text size = 25 onfocus=forasp.f(this,91);  onblur=forasp.cl(this) l=10 title=要求的長度><br></p><br>
    <div id=forasp_cn style=border: 3px solid rgb(127, 157, 185); padding: 1px 1px 1px 1px; position: absolute; z-index: 999; background-color: rgb(242, 242, 242);  height: 18px; top: 270px; left: 200px;display:none; >這里是隱藏的一個層,主要用來顯示提示內(nèi)容</div>
    </body>
    </html>