Validate form on click to MultiUpload

8 months ago

lukendo
Member | 83
+
0
-

Hi, in my form a i had a MultiUpload. When a i click on this control, form calls a onValidate function. But I used a setValidationScope(FALSE), but issue is still active. Can you help me please, where is a problem? Thanks.

$form->addText('path')->setAttribute('placeholder', "path of files")->getControlPrototype()->id('uploadFile')->setValidationScope(FALSE);
        $form->addMultiUpload('files')->getControlPrototype()->id('uploadBtn')->class('upload')->setValidationScope(FALSE);
$form->onValidate[] = [$this, 'validateForm'];
public function validateForm($form)
{
        if ($form->submitted->getValidationScope() === NULL) { ... }
}

Tracy:

Call to a member function getValidationScope() on a non-object