账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    Validform 的自定义datatype动态验证;返回return res.msg是字符串为什么也显示成功
    • 2018-09-10 00:00
    • 10
    30
    0

    $("#addFrom").Validform({

            datatype:{
                  "zh2-4":/^[\u4E00-\u9FA5\uf900-\ufa2d]{2,4}$/,
                  "ajaxCode": function(){
                      
                      $.ajax({
                            url:'${basePath}webCompanyInfo/check',
                            type:"POST",
                            data:data,
                            success:function(res){
                               
                                if(res.status){
                                   return true;
                                }
                            },
                            error:function(){
                                 return res.msg;
                            }
                        })
                        
                    }
                    
            },tiptype:function(msg,o,cssctl){
                
                    
                
                    if(!o.obj.is("form")){
                        if(o.type==2){
                        
                            
                            layer.tips('验证通过!',o.obj,{tips:[2,"#66ee99"]});
                        
                        }else{
                        
                            o.obj.css('border-color','#fd5353');
                            layer.tips(msg,o.obj,{tips:[2,"#fd5353"]});
                        }
                    }
        }});
    0
    打赏
    收藏
    点击回答
    您的回答被采纳后将获得:提问者悬赏的 10 元积分
        全部回答
    • 0
    • 迷失自己 普通会员 1楼
      502 Bad Gateway

      502 Bad Gateway


      nginx
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部