For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > August 2004 > Re: [PEAR] quickform exportValues never returns null ?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR] quickform exportValues never returns null ?
Alexey Borzov

2004-08-22, 4:01 pm

Hi,

Jeroen Houben wrote:
> It seems that exportValues never returns null for text inputs, even when
> no value was entered.


Yes, because text input always have a submit value unlike f.e. a checkbox.

> That's not such a bit deal, I thought I can
> overcome this by writing a filter:
>
> function emptyStringsToNull($value)
> {
> return ($value == '') ? null : $value;
> }
>
> But after running that, exportValues still doesn't return nulls, only
> empty strings ('');
> Is this normal behaviour? Should I just run the filter over the
> exportValues to get nulls instead of empty strings?


I think that's the best approach.

QuickForm may indeed have some problems handling nulls after your filter as you
don't get nulls form forms normally.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com