Hi everybody
I’am using CMultiFileUpload and want to disable sumbit button when no files are selected.
I’ve use code below, but m.list.length stay not-zero even when all files are deleted from list.
Thanks for your advices!
$this->widget('CMultiFileUpload', array(
'name'=>'files',
'accept'=>'xls|xlsx',
'max' => 5,
'options'=>array(
'afterFileAppend'=>'function(e, v, m){
if(m.list.length > 0) $("#submit").removeAttr("disabled"); else $("#submit").attr("disabled", "disabled");
}',
'afterFileRemove'=>'function(e, v, m) {
if(m.list.length > 0) $("#submit").removeAttr("disabled"); else $("#submit").attr("disabled", "disabled");
}',
),
));