当前位置:编程学习 > JAVA >>

jqueryFormvalidator Ajax修改数据验证是否存在

var accErrorMsg = "请输入客户分类名称";
//表单数据验证
$(function(){
                //$.formValidator.initConfig({formid:"myform",autotip:true});   
        $.formValidator.initConfig({
                    formid:"myform",
                    autotip:true
                });
                
                $("#name").formValidator({
                onshow:"请输入客户分类名称",
                onfocus:"2至20个字符",
                oncorrect:"输入正确"}).functionValidator({
                                        fun: function(){
                                            var roleName = $("#name").val();
                                            if(trim(roleName)=="")
                                            {
                                                 accErrorMsg = "请输入客户分类名称";
                                                 return accErrorMsg;
                                            }else if(trim(roleName).length==1 ||trim(roleName).length>20){
                                                 accErrorMsg="2至20个字符";
                                                 return accErrorMsg;
                                            }
                                            else
                                            {                                               
                                                return true;
                                            }
                                        }
                                    }).ajaxValidator({
                                        type:"post",
                                        url: "${basePath}clientSortSTManage/clientSortST!isClientSortNameExist.action",
                                        datatype: "json",
                                        timeout: 3000,  
                                        success: function(data)
                                        {
   &n

补充:软件开发 , Java ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,