[Zope] Re: dtml radio button

Maik Jablonski maik.jablonski at uni-bielefeld.de
Wed May 12 12:49:01 EDT 2004


Jianping Zhu wrote:
> in file acCreateUser, I want to do that if use choos Yes radio button, i
> will set varible t to string Yes otehrwise set t to string No .
> I have:
>        <dtml-if "teach=='y'">
>        <dtml-let t="Yes"></dtml-let>
>        <dtml-else>
>        <dtml-let t="No"></dtml-let>
>        </dtml-if>
> But this does not work i get error "name 'Yes' is not defined". how can
> i fix this problem?

You need to single quote 'Yes' and 'No' in DTML-Python-Expressions.

         <dtml-if "teach=='y'">
         <dtml-let t="'Yes'"></dtml-let>
         <dtml-else>
         <dtml-let t="'No'"></dtml-let>
         </dtml-if>

-mj




More information about the Zope mailing list