[Zope] redirection from within forms with submit button
dvl
dvl <dvl@wanadoo.nl>
Thu, 28 Mar 2002 07:14:28 +0100
Hello Andy
> Must admit I cant be bothered to read all this but some notes:
>> <input type="hidden" name="" value="<dtml-call
>> "RESPONSE.redirect('toondecr2?datum=%s&teller=%s' %
>> (datum,teller))">>">
> This is pointless, the page will never be rendered because it will instantly
> do the redirect.
> If you could refactor this a bit to more concise question...
Gosh, you're harsh. I'll try.
Why the instant redirection?
I want to make the redirection conditional on clicking the submit
button.
Why _does_ it work as I'd like it to when in a separate form (you don't
have to read this;)?
The following produces an almost empty webpage with just a submit button. The
required action is only undertaken when the submit button is pressed:
<form method="post" action="">
<input type="submit" name="x" value="> ">
<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>
Cheers, Dirk