前端技巧汇总

$("#manForm").validate({
            errorPlacement : function(error, element) {
                if (element.is("select"))
                {
                    error.appendTo(element.parent());
                }else
                {
                    element.after(error);
                }
            },
            debug: true,
            rules: {
                partyTypeName: {required: true},
                certificateType: {
                    required: true
                },
                cetificateNo: {required: true,
                    isCardNo:true},
                tel: {required: true},
                zip: {isZipCode: true},
                age: {isAge: true}
            },
            messages: {
                partyTypeName: {
                    required: "当事人类型不能为空"
                },
                certificateType: {
                    required: "证件类型不能为空"
                },
                cetificateNo: {
                    required: "证件号码不能为空",
                    isCardNo:"请填写正确的身份证号码"
                },
                tel: {
                    required: "电话不能为空"
                }
            }
        });
        $('#country1').selectpicker({
            liveSearch: true
        });
        $('#country2').selectpicker({
            liveSearch: true
        });
    });

 

posted @ 2019-09-16 16:33  Shapley  阅读(136)  评论(0编辑  收藏  举报