[Zope] How to emulate browser back button
Tino Wildenhain
tino@wildenhain.de
Mon, 03 Apr 2000 20:58:51 +0200
Hello,
Richard Moon wrote:
>
> I feel there must be a way to emulate the browser 'back' button in Zope.
> Can anyone tell me if this is possible please ?
>
> The reason is that I have a form, with input fields like
>
> input name="address1"
> width=30 value="&dtml.missing-address1;">
>
> Input from the form is validated in the dtml-method which receives the
> input from the form. So if a particular field is invalid I can tell the
> user to use their back button to return to the form. Using the
> &dtml.missing- means that other data already entered is re-displayed to the
> user. This is excellent stuff.
>
> However, rather than telling the user to press the back button I want to
> put an anchor on the screen which says continue - something along the lines of
>
> <a href="<dtml-var HTTP_REFERER>">Continue</a>
>
You could use:
<dtml-if HTTP_REFERER>
<form method="POST" action="<dtml-var HTTP_REFERER>">
<dtml-in "REQUEST.form.keys()">
<input type="hidden" name="<dtml-var sequence-item>" value="<dtml-var
"_['sequence-item']">">
</dtml-in>
<input type="submit" name="dummy" value="Continue">
</form>
</dtml-if>
And so look for your forms varibles in the input page.
HTH
Tino Wildenhain