`

costom validate function

阅读更多

<script type="text/javascript">
function js(id){
    return document.getElementById(id);
}
function checkInput(){
    js("msg").innerHTML ="";
    var loginName = js("loginName").value;
    var loginPwd = js("loginPwd").value;
    var valiCode = js("valiCode").value;
   
    if(loginName.length==0){
        js("msg").innerHTML ="用戶名不能為空!";
    }else if(loginName.length<5){
        js("msg").innerHTML ="用戶名長度為6-20字符!";
    }else if(loginPwd.length==0){
        js("msg").innerHTML =" 密碼不能為空!";
    }else if(loginPwd.length<5){
        js("msg").innerHTML ="密碼長度為6-20字符!";
    }else if(valiCode.length!=4){
        js("msg").innerHTML ="驗證碼長度為4位!";
    }else if(isNaN(valiCode)){
        js("msg").innerHTML ="請輸入數字驗證碼!";
    }else{
        js("msg").innerHTML ="";
        js("loginForm").submit();
    }
}
//alert(loginName+":" + loginPwd+":"+ valiCode);
</script>

分享到:
评论

相关推荐

    数位板压力测试

    5. Function Reference 7 5.1. Basic Functions 7 5.1.1. WTInfo 8 5.1.2. WTOpen 9 5.1.3. WTClose 10 5.1.4. WTPacketsGet 10 5.1.5. WTPacket 11 5.2. Visibility Functions 11 5.2.1. WTEnable 11 5.2.2. ...

    表单验证框架使用及说明

    &lt;bspHtml:text styleClass="validate[required,custom[onlyNumberSp]]" property="user.loginName" size="45" styleId="user.loginName"&gt; 验证规则非常多样,基本上包含了所有的数据类型的验证。

    formwizard:基于jQuery UI的jQuery插件,可将表单转换为多步向导。 与用于提交AJAX表单的jQuery表单插件,用于客户端验证的验证插件以及用于启用浏览器后退和前进按钮的BBQ插件集成在一起

    jquery.validate.js bbq.js jquery-ui-1.8.5.custom.min.js jquery.form.wizard- {version} 用法示例。 这是一个非常简单的设置。 $ ( function ( ) { $ ( "#demoForm" ) . formwizard ( {

    表单验证Validator v1.0(CHM) 下载

    Validate : function(theForm, mode){ var obj = theForm || event.srcElement; var count = obj.elements.length; this.ErrorMessage.length = 1; this.ErrorItem.length = 1; this.ErrorItem[0] = obj; for...

    WordPress 2.8 Theme Design.pdf

    Chapter 6: WordPress Template Tag, Function, and CSS Reference 155 Class styles generated by WordPress 156 The search bar ID 156 Classes output by the media manager 157 Classes output by the ...

    python3.6.5参考手册 chm

    PEP 471 - os.scandir() function – a better and faster directory iterator PEP 475: Retry system calls failing with EINTR PEP 479: Change StopIteration handling inside generators PEP 485: A function...

    hibernate.properties

    ## define query language constants / function names hibernate.query.substitutions yes 'Y', no 'N' ## select the classic query parser #hibernate.query.factory_class org.hibernate.hql.internal....

    ZendFramework中文文档

    4.3.3. Zend_Cache_Frontend_Function 4.3.3.1. Introduction 4.3.3.2. A可用的选项 4.3.3.3. 例子 4.3.4. Zend_Cache_Frontend_Class 4.3.4.1. Introduction 4.3.4.2. Available options 4.3.4.3. Examples ...

    stdafx.h代码

    stdafx.h的代码// This is a part of the Microsoft Foundation Classes C++ library. ...// All rights reserved. // // This source code is only intended as a supplement to the // Microsoft Foundation Classes ...

    GENESIS 2000 DFM PE

    to add custom features to the system immediately, as and when required, without having to wait for the R&D department to deliver. These customized features are not added on as scripts to be ...

    ORACLE OSB开发指南

    Creating Custom Resources.............................................................................................................. 2-4 Creating and Editing JNDI Provider Resources ..................

Global site tag (gtag.js) - Google Analytics