[Zope] tal:atrributes problem

Jürgen Herrmann Juergen.Herrmann at XLhost.de
Wed Mar 23 06:11:12 EST 2005


try something like this:

<option tal:content="district/district_name"
        tal:attributes="selected
python:test(distname==district.district_name, 'selected',
'')"></option>

regards, juergen herrmann

[ prabuddha  ray wrote:]
> sir,
>      i guess i'm not gettin it. kindly tell me the syntax. wats
> happeneing is dat its setting the last item as selected.
> where as i want the item matching the result from 'distname' var
> sud be selected only.
> kindly gimme the syntax if possible.
>
>
> On Wed, 23 Mar 2005 Jürgen Herrmann wrote :
>>
>>i succeeded in either setting the selected attribute to
>>"selected"
>>or "", hth
>>
>>juergen herrmann
>>
>>[ prabuddha  ray wrote:]
>> >    I've got to set the particular item selected in a dropdown
>>list
>> > which was in the request object.this is fetched by reloading
>>the
>> > page.
>> >
>> > i've a var 'distname' which holds wat has been selected
>> >
>> > <body tal:define="distname
>>request/form/districtname|nothing"
>> > onload="foc()">
>> >
>> > wen i use this in my option tag of the list with the attribute
>>tag
>> > nothing happens.
>> >
>> > <option tal:content="district/district_name"
>> > tal:attributes="selected distname"></option>
>> >
>> > i guess coz the 'selected' attribute don take any values.
>> > so how do do it?
>> >
>> > _______________________________________________
>> > Zope maillist  -  Zope at zope.org
>> > http://mail.zope.org/mailman/listinfo/zope
>> > **   No cross posts or HTML encoding!  **
>> > (Related lists -
>> >  http://mail.zope.org/mailman/listinfo/zope-announce
>> >  http://mail.zope.org/mailman/listinfo/zope-dev )
>> >
>
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
>


_______________________________________________________________________

>> XLhost.de - eXperts in Linux hosting <<

Juergen Herrmann
Weiherweg 10, 93051 Regensburg, Germany
Fon:  +49 (0)700 XLHOSTDE [0700 95467833]
Fax:  +49 (0)721 151 463027

ICQ:  27139974  -  IRC: #XLhost at quakenet
WEB:  http://www.XLhost.de


More information about the Zope mailing list