Code Comments
Programming Forum and web based access to our favorite programming groups.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.
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.