[Zope] How to get the value of form data in Page Template itself?

J Cameron Cooper jccooper@jcameroncooper.com
Wed, 21 May 2003 14:44:35 -0500


>
>
>> I have a form in a page template. Submission of the form calls the 
>> same page again with some other parameters. I want to get the value 
>> of the parameter(form data) in the Page Template itself.
>> Its very urgent for me...
>> Hope somebody helps me
>
>
> If your form does:
>
> <input type="text" name="whatever" value="something like this" />
>
> try:
>
> <div tal:content="request/whatever"></div>
>
> Which will output in the HTML source:
>
> <div>something like this</div>

And if you want it in the input element itself, you can do

<input type="text" name="whatever" value="something like this" 
tal:attributes="value request/whatever | default" />

which reads as "...and replace the attribute 'value' with the contents 
of the request parameter 'whatever' or leave the parameter alone if 
there is no such parameter."

          --jcc