[Zope] reload page after form submission

Michel Pelletier michel@digicool.com
Wed, 1 Dec 1999 17:16:27 -0500


> -----Original Message-----
> From: Darcy Clark [mailto:darcyc@engin.umich.edu]
> Sent: Tuesday, November 30, 1999 6:41 PM
> To: zope@zope.org
> Subject: [Zope] reload page after form submission
> 
> 
> hi,
> 
> I have DTML Method (0index_html) that contains a html form - the
> 'action' for this form is another DTML Method : i.e 
> 
> <form action="added_announcement_html" method="post"> 
> 
> added_announcement_html contains a 'call' statement to INSERT the data
> into a MySQL database, i.e :
> 
> <!--#call add_announcement_sql-->
> 
> <!--#call "RESPONSE.redirect('0index_html')"-->
> 
> ,and contains a call statement to reload the original page with the
> newly added data.
> 
> My question is this : is there a more way to submit the form 
> and reload
> the page without making a second method (in my case
> added_announcement_html) to make the calls to the SQL and Redirect
> statements ? My folders are rapidly filling up with these sorts of
> methods and I would prefer to cut down on redundant methods if I can.

Just have the form method call itself, and use DTML to detect whether or
not it is being called from itself and to insert the data if so.

-Michel