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

你可能感兴趣的:(easyui)