easyui 验证动态添加和删除问题

$.extend($.fn.validatebox.methods, {  
    remove: function(jq, newposition){  
        return jq.each(function(){  
            $(this).removeClass("validatebox-text validatebox-invalid").unbind('focus').unbind('blur');
        });  
    },
    reduce: function(jq, newposition){  
        return jq.each(function(){  
           var opt = $(this).data().validatebox.options;
           $(this).addClass("validatebox-text").validatebox(opt);
        });  
    }   
});

//使用
$('#id').validatebox('remove'); //删除
$('#id').validatebox('reduce'); //恢复

 

posted @ 2017-09-12 10:45  好撒玛利亚人  阅读(443)  评论(0编辑  收藏  举报