Re: Fileupload in HTML_OOH_Form
| From: | Jan Wagner | Date: | Wed, 09 Oct 2002 11:54:20 +0000 |
| Subject: | Re: Fileupload in HTML_OOH_Form | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-9961@lists.php.net to get a copy of this message | ||
Am Die, 2002-10-08 um 10.00 schrieb Markus Wolff:
> Hi there,
> What happens is, if I submit the form and try to access the name of the
> uploaded file with $form->getValue('elementName'), the value is empty -
> so the form is completely unusable.
You still have to use $_FILES to access the file, I guess. It seems the
fileupload element just does the drawing of the HTML part. You would
have to implement a php validation function which checks whether the
file complies to your rules. Thats what I am doing ;-)
> Also, when I try to validate the form using $form->validate(), the
> script throws:
>
> > Call to undefined function: validateregex() in
> > c:\Inetpub\php422\pear\HTML_OOH_Form\elements\form_element_file.php
> > on line 136
>
> It doesn´t matter if I define a regex validation rule for the fileupload
> element or not, it will always try to access validateregex() which
> doesn´t seem to exist (at least not in this context).
I had the same problem. This seems to be a leftover from an old version
as validation is now done via $this->container->validate() in
form_element.php. This function is overwritten in form_element_file.php,
so I removed the function and it works for now. After further
investigation it seems the function can be overwritten by the custom
elements to do some further checking (valid date etc.) as can be seen in
form_element_combo.php.
Jan