Re: QuickForm: How do I reset a value ?
| From: | Alain Williams | Date: | Tue, 14 Feb 2006 17:19:11 +0000 |
| Subject: | Re: QuickForm: How do I reset a value ? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-22963@lists.php.net to get a copy of this message | ||
On Mon, Feb 13, 2006 at 09:58:56PM +0000, Alain Williams wrote:
> I have a simple form, that the user fills in, it passes validation, I put the values in a
> database,
> I then want to present the same form to the user so that they can fill some more values in,
> wash/rince/repeat.
>
> It all works, except that the second time round the user is presented with the data that they
> entered
> last time - I want them to see a nice empty form.
> ...
OK: I did it, this is how:
1) $_POST = array();
2) I put the code to generate the form into a function - so easy to call somewhere else.
It is important that $_POST is cleared *before* regenerating the form.
Cheers
--
Alain Williams
Parliament Hill Computers Ltd.
Linux Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256 http://www.phcomp.co.uk/
#include <std_disclaimer.h>