[Zope] Python, Pre-Fill Form Fields

Paul Winkler pw_lists at slinkp.com
Mon Feb 23 14:43:55 EST 2004


On Mon, Feb 23, 2004 at 01:15:11PM -0500, AdvertisingDept wrote:
> How do I...
> use a python script to pre-fill the value of a form's field?

You just check the request in the template.
 
> I am setting a field in the request, 
> but it appears in the 'other' section of the request.

Doesn't matter.
 
> Page Template -  html form
> -------------------------------
> <html>
>   <body>
>      <form method="POST" action="">
>       Enter text: 
>       <input name="aformfield" type="text" value="" />

Try something like:

       <input name="aformfield" type="text" value="" 
        tal:attributes="value request/aformfield | default" />

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's MEGA RAR-PUMA!
(random hero from isometric.spaceninja.com)



More information about the Zope mailing list