在使用带 validatebox 的输入框,第一次没输入出现如图验证提示信息
但是点击窗口取消后,再次打开窗口后输入框仍然带有验证信息,查看APi也没有找到解决的方法于是分析了一下页面代码,采用下面处理成功,
$(".validatebox-tip").remove();
$(".validatebox-invalid").removeClass("validatebox-invalid");
$(".validatebox-invalid").removeClass("validatebox-invalid");
另外,有一篇文章
easyui验证的删除和恢复 地址http://liuna718-163-com.iteye.com/blog/1726145 供参考
引用一下他的代码:
$.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'); //恢复