[Zope] REQUEST.form.set ???
Is it possible for DTML to create or modify a form value? I understand that REQUEST.form is a dictionary, but I cannot seem to add dictionary elements. I've tried dtml-call expr="REQUEST.form['test']='value'" dtml-call expr='REQUEST.form["test"]="value"' dtml-call expr="REQUEST.form.set('test','value')" but none of them work. What am I doing wrong here? Brian Withun ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] REQUEST.form.set ???
maybe this will help: dtml-call "REQUEST.set('lname',REQUEST.form['Last_Name'])" From: "Brian Withun" [EMAIL PROTECTED] Date: Tue, 29 Aug 2000 12:02:42 -0400 To: "Zope mailing list" [EMAIL PROTECTED] Subject: [Zope] REQUEST.form.set ??? Is it possible for DTML to create or modify a form value? I understand that REQUEST.form is a dictionary, but I cannot seem to add dictionary elements. I've tried dtml-call expr="REQUEST.form['test']='value'" dtml-call expr='REQUEST.form["test"]="value"' dtml-call expr="REQUEST.form.set('test','value')" but none of them work. What am I doing wrong here? Brian Withun ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] REQUEST.form.set ???
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 ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )