[Zope] REQUEST.form.set ???

Dieter Maurer dieter@handshake.de
Wed, 30 Aug 2000 00:18:46 +0200 (CEST)


Brian Withun writes:
 > Is it possible for DTML to create or modify a form value?
It is possible to extend any dictionary, especially
"REQUEST.form". You use the dictionary "update" method
as in

	<dtml-call "REQUEST.form.update({'a':1, 'b':2})">

It will, however, not work as you might expect.
This is because the DTML namespace *does not* look into "REQUEST.form"
but into the dictionary "REQUEST.other".
During "REQUEST" construction, the "other" dictionary is updated
with the "form" dictionary. Therefore, you see form variables, too,
in the DTML namespace. However, later updates to "REQUEST.form"
are not automatically propagated to "REQUEST.other" (and
therefore not seen via the DTML namespace).

You can use
	<dtml-call "REQUEST.other.update({'a':1, 'b':2})">

or (as someone else suggested) "REQUEST.set".



Dieter