[Zope] REQUEST object - obtaining variables from
Jens Vagelpohl
jens@digicool.com
Sat, 13 Jan 2001 19:32:34 -0500
here's how you could display the form variables on the receiving object:
<tested>
<dtml-in expr="REQUEST.form.items()">
<dtml-var name="sequence-key">: <dtml-var name="sequence-item"><br>
</dtml-in>
</tested>
REQUEST.form will contain all the fields from the form and
REQUEST.form.items() will give you access to all key-value pairs that you
can then access with sequence-key and sequence-item in the loop.
jens
on 1/13/01 13:11, Lee at lee.reilly@ntlworld.com wrote:
> Hi,
>
> I am having some problems with the REQUEST namespace/object. I
> understand that if I submit form data then it can be retrieved using the
> REQUEST object. I have looked at Chapter 7 (Advanced DTML) for support
> but I'm still no closer to success.
>
> I have a DTML method, which passes an unknown number of arguments with
> unknown names to another method. For example,
>
> <form action="display">
> Name <input type="text" name="name1"><br>
> Age <input type="text" name="age1"><br>
> Name <input type="text" name="name2"><br>
> Age <input type="text" name="age2"><br>
> <input type="submit">
> </form>
>
> I would like the display method to simply show each of the variable's
> names and values i.e. iterate through each variable in the REQUEST
> object. Maybe I've overlooked something in the Zope documentation but
> could someone supply a useful snippet of code to get me started?
>
> Thanks very much,
>
> Lee