Re: QuickForms: numbers as strings
| From: | Bertrand Mansion | Date: | Mon, 10 Mar 2003 14:20:57 +0000 |
| Subject: | Re: QuickForms: numbers as strings | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-4131@lists.php.net to get a copy of this message | ||
<jeroen@terena.nl> wrote :
> Hi Bertrand,
>
> The folowing code doesn't show numberA because the 0 isn't quoted. All
> values are shown in normal (unfrozen) state. IMO it should also show the
> 0 in frozen state, even if it's not explicitly quoted. What do you think?
>
> Jeroen
>
> <?php
> require 'HTML/QuickForm.php';
> $DEFAULTS['numberA'] = 0;
> $DEFAULTS['numberB'] = "0";
> $DEFAULTS['numberC'] = 1;
> $form = new HTML_QuickForm;
> $form->setDefaults($DEFAULTS);
> $form->addElement('text','numberA','Some number');
> $form->addElement('text','numberB','Some number');
> $form->addElement('text','numberC','Some number');
> $form->freeze();
> $form->display();
> ?>
I'll have a look at that for the next release. The problem is that the form,
once submitted, returns only strings, even if the field content is 0. I
think treating every values as strings is easier. I'll see...
Bertrand Mansion
Mamasam