JQuery EasyUI 之 validatebox plugin

自定义验证:

            $.extend($.fn.validatebox.defaults.rules,{
                remote2:{
                    validator:
function(value,param){
                        
var postdata={};
                        postdata[param[
1]]=value;
                        
var result=$.ajax({
                            url:param[
0],
                            dataType:
"json",
                            data:postdata,
                            async:
false,
                            cache:
false,
                            type:
"post"
                        }).responseText;
                        
return result=="true";
                    },
                    message:
"Please fix this field."
                }

            }); 

posted @ 2011-07-15 17:36 nikytwo 阅读(...) 评论(...) 编辑 收藏