newbie : select tag value setting problem
I've this 'district' select tag .I'm getting the values usinga ZSQL method. I want to set the value of the option by the district code and the display the district name. I tried this : <div tal:repeat="district container/getDistrict"> <option tal:attributes="selected python:test(distname==district.district_name, 'selected',''); value district/district_code"> <span tal:content="district/district_name"></span> </option> </div> the drop down list is getting the district names but value is being set only once. i checked the request values and its giving the 1st list value everytime. plz tell me how should i use the tal:attribute tag here so as to get both the 'value' and the 'name' values as a list. -- Share the vision of difference with ME
--On Mittwoch, 13. April 2005 2:14 Uhr -0700 prabuddha ray <buddharay@gmail.com> wrote:
I've this 'district' select tag .I'm getting the values usinga ZSQL method. I want to set the value of the option by the district code and the display the district name.
I tried this : <div tal:repeat="district container/getDistrict"> <option tal:attributes="selected python:test(distname==district.district_name, 'selected',''); value district/district_code"> <span tal:content="district/district_name"></span> </option> </div>
the drop down list is getting the district names but value is being set only once. i checked the request values and its giving the 1st list value everytime.
- either your test() always evaluates to false - try tal:attributes="SELECTED (in upper case)
plz tell me how should i use the tal:attribute tag here so as to get both the 'value' and the 'name' values as a list. --
What does this mean? -aj
participants (2)
-
Andreas Jung -
prabuddha ray