[ZPT] option selected? (nevermind)

Jason Byron jason_zope@yahoo.com
Fri, 29 Jun 2001 21:18:14 -0700 (PDT)


> This may have been covered before, but how do you do a repeat
> for a html select and set one of the options to 'selected'?
> 

nevermind, I figured it out. here's what I came up with:

<select name="select_name">
  <option tal:repeat="line python:['one','two','three']"
tal:content="line" tal:attributes="value line; selected
python:line == session['current_selection']"></option>
</select>

though I suppose if your not using sessions you could have
used request/select_name instead.


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/