Re: Quickform custom validation rule + validating file
| From: | Alexey Merkulove | Date: | Fri, 29 Oct 2004 11:43:27 +0000 |
| Subject: | Re: Quickform custom validation rule + validating file | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-15218@lists.php.net to get a copy of this message | ||
Thanks, it works this way
Best regards, Alexey Merkoulove
"Alexey Borzov" <borz_off@cs.msu.su> ???????/???????? ? ???????? ?????????:
news:41812CE6.7050401@cs.msu.su...
> Hi,
>
> Alexey Merkulove wrote:
> > If i have a custom rules in my form, how i supose to deal with files
upload,
> > cause if i put something like this, it's not woking:
> >
> > function ne_mod_validating($values)
> > {
> >
> > if (empty($values['myfile']) && $values['mod']<0){
$errors['myfile'] =
> > 'Error in file!';}
> > }
>
> Well, I didn't remember that stuff myself, but looking at the code in
QuickForm
> foreach ($this->_formRules as $rule) {
> if (true !== ($res = call_user_func($rule, $this->_submitValues,
> $this->_submitFiles))) {
>
> I'd say that you need
> function ne_mod_validating($values, $files)
> {
> ...
> }