validate a disabled required form element

i think it’s may help some one!

if you want to disable a required form element for any purpose, and this one is required in the form declaration (for ajax validation ) there is a way to bypass the ajax validation:

in CRequiredValidator.php , line 91 there is an :


if($.trim(value)=='') {

	messages.push(" . CJSON::encode($message) . ");

}



replace it with




if($.trim(value)==''&& $('#'+$(this).attr('id')+'').attr('disabled')!='disabled') {

	messages.push(" . CJSON::encode($message) . ");

}