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")); } }); });