General developer forum

Moodle form - filemanager

Moodle form - filemanager

Hi all,

I have an editor element and a filemanager element in my form, with the simple code below:

 $filemanager_options = array();
        $filemanager_options['accepted_types'] = array('audio', 'video', 'document');
        $filemanager_options['maxbytes'] = 0;
        $filemanager_options['maxfiles'] = -1;
        $filemanager_options['mainfile'] = true;

        $mform->addElement('filemanager', 'files', 'Add a file to your response', null, $filemanager_options);

Somehow, if I submit the form without anything in the filemanager element, I get a required error on my filemanager. I dont want the filemanager to be mandatory. How I can do this? How I can I make my filemanager NOT be mandatory for the user?



Average of ratings: -