Hi.
If X was selected, when you create form instance before running validation,
pass boolean var to constructor options:
$form = new YourForm(array('your_bool_var' => $X));
implement set method in your form for this key, and put it as class member,
then in init, when adding file element, just pass that member to required
setting of file element.
Hope this helps :)
Regards,
Saša Stamenković
On Tue, Dec 8, 2009 at 10:35 AM, Andrei Iarus <[email protected]> wrote:
> Hello,
>
> I want to validate an File Element, depending on another element (called X)
> so:
>
> if X was selected, the File Element should be required. The problem is that
> the validator of File Element doesn't get triggered (called), if no File was
> selected (and of course, the File Element is not set as required by
> default).
>
> Any solutions to that?
>
> Thanks in advance.
>
>