[Zope] Setting the "selected" attribute in zpt

Max M maxm@mxm.dk
Mon, 27 Jan 2003 15:45:50 +0100


I have a Python product with the values:

self.languages = ['dk','uk']
self.language = 'uk'

I am trying to rewrite a bunch of old proucts with these new-fangled 
PageTemplates. But I cannot seem to set the selected attribute correctly:

<select name="language" class="selector">
     <option tal:repeat="langItem here/languages" value=""
     tal:attributes="value langItem;
         selected python:langItem==here.language"
     tal:content="langItem">Language</option>
</select>


The rendered source looks like this:

<select name="language" class="selector">
     <option value="dk">dk</option>
     <option value="uk" selected="selected">uk</option>
</select>

This  (selected="selected") doesn't work in the browsers.

Can anyone see what I am doing wrong?

-- 

hilsen/regards Max M Rasmussen, Denmark

http://www.futureport.dk/
Fremtiden, videnskab, skeptiscisme og transhumanisme