Home  >  Article  >  php教程  >  jQuery sets Easyui validation rules (recommended)

jQuery sets Easyui validation rules (recommended)

高洛峰
高洛峰Original
2016-12-06 10:27:471210browse

No more nonsense, let me just post the code for you. The specific code is as follows:

//JQuery EasyUI 动态改变表单项的验证规则
$(document).ready(function(){
$('#FILE_QUALITY').combobox({
onChange:function(newValue,oldValue){
if(newValue == 2){
$('#FRONT_FOR_UNIT').validatebox({
required: false
});
} else if(newValue == 0){
$('#FRONT_FOR_UNIT').validatebox({
required: true,
validType: 'length[1,512]'
});
}
$.parser.parse($("#FRONT_FOR_UNIT"));
}
});
});


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn