[Zope] how to select selected optoin: newbie

Chris Withers chrisw@nipltd.com
Mon Aug 4 12:04:43 EDT 2003


Jeremy Tammik wrote:

>>Ive been trying to make this select list auto select
>>the request variable.
>>
>><SELECT name="country">
>>                  <OPTION tal:repeat="world
>>here/getCountryMethod" tal:attributes="value
>>world/country" tal:content="world/country"></OPTION>
>>                </SELECT>
>>
>>ZSQL = getCountryMethod ( select * from world
>>ZPT = index_html
>>
>>I have a form which submits a select option to zsql
>>which then goes to index_html where i want the select
>>to selected the variable in request that was sent.

<SELECT name="country">
<OPTION tal:repeat="world here/getCountryMethod"
         tal:attributes="selected python:world.country==request.get('country')" 

         tal:content="world/country"
         tal:></OPTION>
</SELECT>

cheers,

Chris





More information about the Zope mailing list