Re: Clearing a QuickForm
| From: | Bertrand Mansion | Date: | Sat, 12 Apr 2003 21:42:21 +0000 |
| Subject: | Re: Clearing a QuickForm | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-4825@lists.php.net to get a copy of this message | ||
<jon@jellybob.co.uk> wrote :
> I'm using QuickForm in an application at the moment, and I'm trying to
> find a way of clearing fields that have errors (specifically a pair of
> password fields for user signups), and also to clear out a form once
> it's been used, to allow it to be used again for another entry.
>
> I've had a rummage around the source, and setValue seems to be what I
> need, but I'm just wondering if there is anything a little less messy
> then creating a reference for each variable, and then clearing them one
> by one. What I'd really like is to be able to go $form->clear() and have
> the values reset to blanks.
getSubmittedValues() returns the values that were submitted by the form.
setConstants() overrides these values when the form is displayed. If you use
both, you can set an empty constant for the password field and still
retrieve the submitted value.
Bertrand Mansion
Mamasam