Re: Quickform required & freeze vs _file_ (upload)
| From: | Fredrik de Vibe | Date: | Wed, 02 Apr 2003 01:44:06 +0000 |
| Subject: | Re: Quickform required & freeze vs _file_ (upload) | ||
| References: | 1 2 3 4 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-4582@lists.php.net to get a copy of this message | ||
brad@congosystems.com (Brad Hubbard) writes:
> Is this form using "get" as the method? It's my experience that file
> uploads don't work using "get".
No, that wouldn't be a very good idea, as there is a fairly tight
limit on the lenght of the get string. You wouldn't be able to upload
very much that way, even if the "urlisation" of the file works (which
I don't know).
To clarify: File uploading works seamlessly, only that I can't use the
'required' rule in Quickform, as it isn't registered whether the field
is filled in or not.
> [ Fredrik de Vibe ]
> > By date filtering, I mean the same as text field filtering etc.,
> > like
> >
> > $form->applyFilter('MyDate', 'intval');
> >
> > Making sure that all the values are ints. Only this doesn't work
> > as the resulting variable in Quickform is an array, and there is
> > afaics no other applicable filter. I also tried
>
> You may have to write your own filter (this should not be
> difficult). Can you give us more inforamtion on what you want to do?
I want to verify that all the values returned from a "date field"
(some select boxes) are integers, like (pseudo code):
...
<select name="day"><option value=1>1</option>...</select>
<select name="month"><option value=1>1</option>...</select>
<select name="year"><option value=2003>2003</option>...</select>
...
if(<submit>){
$day = (int) $day;
$month = (int) $month;
$year = (int) $year;
...
}
Not by far a big "problem", only that as Quickform afaics endeavors to
make such "tests" unnecessary with filters like 'intval' and
'addslashes'.
To write a function without extending Quickform to achieve this is not
that simple, as the 'date' element consists of several elements. I
might be missing something, but this is how I perceive it.
--
--Fredrik
Truly great madness can not be achieved without significant
intelligence.
-- Henrik Tikkanen