[Zope] redirection from within forms with submit button

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


Hello Oliver,

> Let me rewrite this (ignore the wrapping):

> <dtml-if x>
> <dtml-call "REQUEST.set('datum', _.str('1796/03/11'))">
> <dtml-call "REQUEST.set('teller', 5)">
> <dtml-call "RESPONSE.redirect('toondecr2?datum=%s&teller=%s' % 
(datum,teller))">>
> </dtml-if>

> <form method="post" action="">
> <input type="submit" name="x" value="&gt;&nbsp;">
> </form>

Thanks

> You see, writing the dtml-call in the hidden action has no effect, it 
> seems like you got irritated there.
?? Irritated about my ignorance? Sure.

> Could you perhaps reformulate what you want to do exactly?
> Why do you want a submit button (since you can, as you did, also use 
> normal a hrefs to pass parameters with a GET request)?

I want submit buttons because they are supposed to be more intuitively
recognisable for the user. Another reason is that I have a sort of
horizontal navigation bar which should be able to handle a couple of
redirections (page x images further, jump to a certain day) for which
i seem to need forms anyway.

Obviously I'm missing something (well, a lot). For instance, why does this work in a
separate method:
> <dtml-call "RESPONSE.redirect('toondecr?datum=%s&teller=%s' %
(datum,teller))">>

and not in the method toondecr2 (which is a clone of toondecr with the
submit form added)?

Why can i display the dtml-var's 'datum' and 'teller' in the submit
button:
<input type="submit" name="x" value="<dtml-var datum><dtml-var teller>">
and yet get this error when clicking the submit button:
Error Type: NameError
Error Value: global name 'datum' is not defined

Just can't figure why the variables ain't passed.

Ah well, thanks a lot for your efforts. Have a nice weekend.

Cheers, Dirk