[Zope] redirection from within forms with submit button

dvl dvl <dvl@wanadoo.nl>
Fri, 29 Mar 2002 12:32:49 +0100


Hello Janko,

>> Why the instant redirection?
> The redirection happens on the server the moment the page is rendered.

>> I want to make the redirection conditional on clicking the submit button.
> The the redirection needs to happen in the form processing method not in
> the form itself.


> Here you are doing the redirecting in the in the form itself after it
> get's called as a form processor.

>> <form method="post" action="">
>> <input type="submit" name="x" value="&gt;&nbsp;">
>> <dtml-if x>
>> <dtml-call "REQUEST.set('datum', _.str('1796/03/11'))">
>> <dtml-call "REQUEST.set('teller', 5)">
>> <input type="hidden" name="" value="<dtml-call
>> "RESPONSE.redirect('toondecr2?datum=%s&teller=%s' %
>> (datum,teller))">">
>> </dtml-if>
>> </form>

Sounds good and deep, too deep for me. I just can't translate
<dtml-call "REQUEST.set('teller', _['sequence-number'])">
<dtml-call "REQUEST.set('teller', teller+1)">
<a href="<dtml-var "('toondecr2?datum=%s&teller=%s' % (datum,teller))">">link</a>

into a form. Every time it seems like the form won't pass the
variables.

Well, i'll think some more about your comments. Thanks for responding.
Cheers, Dirk