[ZPT] Editing a field using select tag

Santi Camps santi at gnome-db.org
Sun May 18 16:41:12 EDT 2003


> 
>  I do not think one needs to be an existencialist here ;-)
> 
>  In similar cases I try something like:
> 
> <select>
>   <option selected 
>      tal:repeat="record loop"
>      tal:content="record/title" 
>      tal:attributes="
>         value record/id;
>         selected python:test(is_current_record, default, nothing)" />
> </select>
> 
>  If an attribute in the tal:attributes clause is set to "nothing";
> it will not be rendered.
> 
>  Using "default" for the "select" attributes renders the tag as
> 
>   <option selected="selected' ...
> 
>  I guess this is something that You may want. Only rendering 
> '<option selected ...' seems not to be supported, as it is no valid
> XHTML, but even Netscape4 seems to understand the '<option select="selected"'
> notation.
> 
> Cheers,
> Clemens
> 

Cool !!

It's just what I was looking for.  I was sure that ZPT should have a
more elegant way to do this.  

Thanks very match 

Santi Camps




More information about the ZPT mailing list