[Zope] Clearing forms with session vars set

Charlie Reiman creiman@kefta.com
Thu, 5 Sep 2002 17:47:15 -0700


There mostly isn't. Form reset lives in the browser. You can't signal the
server to do anything from HTML without submitting a form or moving to a new
page.

But you could cook something up with JavaScript. You would need to stick a
little script in the onclear attribute that would signal the server in
addition to clearing the form fields. That would also be beyond the scope of
this group.

> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of AM
> Sent: Thursday, September 05, 2002 5:07 PM
> To: zope@zope.org
> Subject: [Zope] Clearing forms with session vars set
>
>
> Hi,
> I have a lot of forms, which store the form data in sessions when
> submitted, and in case of any errors the server returns to the form page
> with the errors and all the fields in the form populated with data in
> the session.
>
> I also have clear form buttons, which are the standard <input
> type='reset'....> kind. Now I know that because the form fields are
> populated from the session vars, the clear button will not work.
>
> So how do I get around this??
>
> Is there any way to call REQUEST.SESSION.clear() and then reload the
> page when the user clicks on the clear form button??
>
> TIA
> AM