[ZPT] <select><option selected> question

Evan Simpson evan@digicool.com
Tue, 22 May 2001 13:04:59 -0400


From: <daniel.a.fulton@delphiauto.com>
> is this the best way to do an <select><option selected> tag set? it works
but I
> thought there might
> be a shorter route that I missed.

Somewhat shorter:

<select name="location">
    <option tal:define="template_location template_info/location"
                 tal:repeat="location here/locations">
                 tal:condition="location"
                 tal:attributes="value location/ID;selected
python:template_location==location.name"
                 tal:content="location/name"
    >Location Name</option>
</select>

Cheers,

Evan @ digicool