Re: QuickForm: More than form on a page?
| From: | Bertrand Mansion | Date: | Fri, 04 Jul 2003 09:41:37 +0000 |
| Subject: | Re: QuickForm: More than form on a page? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-6465@lists.php.net to get a copy of this message | ||
<pschuster@n-o-g.de> wrote :
> Hi,
>
> is it possible to have more than one QuickForm on a page?
>
> And if yes, I discovered that if the second form is transmitted, the first
> form will also be checked from Quickform (against the $_REQUEST array).
> This is no problem for all element types except "checkbox".
>
> There is a code in "checkbox.php" which checks if the checkbox value (from
> the first form) is *not* transmitted and unchecks the checkbox in this case
> (this prevents QuickForm from using the defaulValue).
> But I've transmitted the second form and not the first, so all values from
> the first form should be untouched.
>
> How can I prevent Quickform from checking the first form if I transmit the
> second?
>
> Here is the code from checkbox.php:
>
> // if no boxes were checked, then there is no value in the array
> // yet we don't want to display default value in this
> case
> if (isset($caller->_submitValues) && 0 <
> count($caller->_submitValues)) {
> $value = $this->_findValue($caller->_submitValues);
> } else {
> $value = $this->_findValue($caller->_defaultValues);
> }
>
> Perhaps it must distinguished between the forms (form names) here but I
> don't know how to implement this.
Hi,
This is a problem I don't think we can do much about.
You could maybe try to set your checkboxes value using setConstants().
This will still allow to get the posted values but each time the form will
be displayed, values will be reset to their default state.
Bertrand Mansion
Mamasam