[Zope] Conditionally selected option with ZPT

Andreas Jung Andreas Jung <andreas@andreas-jung.com>
Wed, 23 Apr 2003 15:48:31 +0200


<option tal:attributes="SELECTED python: ..some_condition">

-aj

--On Mittwoch, 23. April 2003 15:30 Uhr +0200 Fabio Rolando 
<ziofunk@tiscali.it> wrote:

> Hi.
> I need to write a Page Template with a conditionally selected <OPTION>.
>
> In DTML I would write
>
> <select name="numero_bimestre">
>    <option value="1" <dtml-if
> expr="propertysheets.props.numero_bimestre==1">selected</dtml-if>>gen-feb
> </option>    <option value="2" <dtml-if
> expr="propertysheets.props.numero_bimestre==2">selected</dtml-if>>mar-apr
> </option>    ...
> </select>
>
> Well, I don't find a way to do this with "tal" statements.
> I hope you can help me.
>
> Than you in advance
> Regards
> Fabio
> 	
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )