[thelist] reseting a form (with a twist)

Nick Wilson nick at explodingnet.com
Fri Mar 1 12:53:00 CST 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


* and then .jeff declared....
> nick,
>
> > Okay, not as simple as it sounds.  A reset button on my
> > form will not work as the values of the form fields are
> > php oject properties that are in the current session.
>
> sure it will.  it'll do exactly what it was designed to do -- return the
> form fields to their default values.

Oh, jeff. Does it require special equipment to split a hair so finely?
You /know/ what I mean.

> > So I need to make my reset button destroy the session
> > vars or reset them to "". I thought maybe it could be
> > a submit that would include a hidden field that would
> > set the 'mode' to reset (the mode is just another var
> > like validate, success and error)
>
> sounds like you've already got the solution in hand, though it needn't be so
> complicated.  just make the reset button a regular submit.  in your
> server-side code, check for this particular form field with a of "Reset".
> if it's present, just change your mode.  the easiest is if you name all your
> submit buttons "submit".  then you just have to check the value of the same
> field to determine what action you should take.

Fantastic, I can see it now. That's an excellent suggestion. Thanks very
much!
- --
- -----------------------------------------------------------
 www.explodingnet.com   |    Projects, Forums and
                        +    Articles for website owners
- -- Nick Wilson --     |    and designers.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8f85eHpvrrTa6L5oRAsGNAJ41sUg1bYb4X8Z7tq9MwADXF6rVoACcDcdX
rUBd4SLlqGK/D0xm64LOmHE=
=Axe+
-----END PGP SIGNATURE-----



More information about the thelist mailing list