Garry Saddington wrote:

I have a variable called 'groupabbrev' in the REQUEST. I am trying to automatically select an option in a select list based on this variable. I have tried this code and many others, and many googles but have not found anything that works. Can anyone see what I am doing wrong?

<select name="groupabbrev">
<dtml-in getpastoralgroups>
<option value="<dtml-var groupabbrev>" <dtml-if expr="'groupabbrev'==_['sequence-item']"> selected</dtml-if> ><dtml-var groupabbrev></option>

Why have you put 'groupabbrev' in quotes? That makes it a string, and the condition will only be true when the current item is equal to "groupabbrev".

Presumably you want the value of the variable named that, rather than a string of that name.

Also, watch the values of what 'getpastoralgroups' returns. The condition will never be true if they are not strings or converted into such.

"Building Websites with Plone"

Enfold Systems, LLC
Zope maillist  -
**   No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to