Re: quickform exportValues never returns null ?
| From: | Alexey Borzov | Date: | Sun, 22 Aug 2004 13:27:24 +0000 |
| Subject: | Re: quickform exportValues never returns null ? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-14219@lists.php.net to get a copy of this message | ||
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) {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.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?