jquery.validate新增重置验证方法,将valid替换为resetValid用户体验会更好
This commit is contained in:
@@ -61,7 +61,7 @@ for (c in child.columnList){
|
||||
editable:true, edittype:'select', editoptions:{<%if (c.showType == 'select_multiple' || c.showType == 'checkbox'){ %>multiple:true, <% } %>'class':'form-control${cssClass}',
|
||||
items: $.merge([<%if (!(c.showType == 'select_multiple' || c.showType == 'checkbox')){ %>{dictLabel:' ',dictValue:''}<% } %>], \${@DictUtils.getDictListJson('${c.optionMap['dictType']}')}),
|
||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||
$(element).select2().on("change",function(){$(this).valid()});
|
||||
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -166,9 +166,9 @@ $("#inputForm").validate({
|
||||
});
|
||||
$('#corpCode_').change(function(){
|
||||
if ($('#loginCode').val() != ''){
|
||||
$('#loginCode').valid();
|
||||
$('#loginCode').resetValid();
|
||||
}else{
|
||||
$('#loginCode').val('admin'+$(this).val()).valid();
|
||||
$('#loginCode').val('admin'+$(this).val()).resetValid();
|
||||
}
|
||||
});
|
||||
//加载角色列表
|
||||
|
||||
@@ -237,7 +237,7 @@ $("#empOfficeGrid").dataGrid({
|
||||
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
||||
items: $.merge([{postName:' ',postCode:''}], ${toJson(postList)}),
|
||||
itemLabel: 'postName', itemValue: 'postCode', dataInit: function(element){
|
||||
$(element).select2().on("change",function(){$(this).valid()});
|
||||
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user