zoukankan      html  css  js  c++  java
  • formValidator 插件 使用总结

    1. 大小写的问题, formvalidator 的属性 大小写问题一定要注意, 在踩过的坑里就包括这个, 把所有属性的第二个字母的开头全部写成大写 ,导致提示信息不能用,这个问题纠结了好久

    2.errorfocus 属性, 这个是控制报错后是否第一错误控件获得焦点,(暂且就这么理解吧)

    3.ajaxValidator 验证控件,这个是用的最多也最容易犯错的,这个一般是配合controll  验证控件值是否存在

    示例:

       $("#txtMessCode").formValidator({ validatorgroup: "2", onfocus: '' })
                    .inputValidator({ type: "size", min: 6, max: 6, onerror: "手机验证码错误" }).ajaxValidator({
                        type: 'post',
                        url: '/member/CheckMobileCode',
                        data:'type=0',
                        async: false,
                        success: function(msg) {
                            if (msg == 0) {
                                return true;
                            } else return false;
                        },
                        onerror: "短信验证码错误",
                        onwait: "正在对短信验证码校验,请稍候..."
                    });
    

     此处没有传入任何 参数,  但是 后台是把 当前validatorgroup :2 的所有控件都传到后台了   ,如果要另外传参数  且 传入参数的控件和当前不在同一组验证中 是不到值的 ,具体为什么我也不清楚

    后台获取参数:

      public int CheckMobileCode()
            {
                var moblie = Request.Params["BindMobile"].ToStr();
                var mcode = Request.Params["txtmobliecode"].ToStr();
                int type = Request.Params["type"].ToInt();
                var result = new GlobalSmsService().CodeCheck(moblie, mcode, type);
                return result.Code;
            }

    注意  bindmobile  都是 控件的name  只有通过name 才能获取到

  • 相关阅读:
    静态变量的问题
    水晶报表动态表数据显示的问题
    USACO Section 1.1 : Friday the Thirteenth
    USACO Section 1.2 : Transformations
    USACO Section 1.1 : Programming Contest Problem Types
    USACO Section 1.2 : Milking Cows
    USACO Section 1.1 : Greedy Gift Givers
    USACO Section 1.1 : Your Ride Is Here
    USACO Section 1.1 : Broken Necklace
    舍入Table.TransformColumns(Power Query 之 M 语言)
  • 原文地址:https://www.cnblogs.com/zplvpp520/p/8109345.html
Copyright © 2011-2022 走看看