[Zope] Compare String to Integer

Allen Schmidt Sr. aschmidt at fredericksburg.com
Tue Apr 21 13:10:00 EDT 2009


<dtml-in getTable>
  <OPTION VALUE="<dtml-var brand_id>" 
    <dtml-if "brand_id==int(pid)">SELECTED
     </dtml-if> /> <dtml-var brand_name>
</dtml-in getTable>

That should do it.
-Allen


Bobby wrote:
> Hi,
>
> I can't compare a string (pid) to an integer (brand_id); what's is wrong with my code below? pid is being passed in the URL as &pid= , brand_id is an integer from a database table. Could someone help me with this so that I could make the if statement comparison work? Thanks.  
>
> <dtml-in "getTable()">
>   <OPTION VALUE="<dtml-var brand_id>" 
>     <dtml-if expr="brand_id==pid">SELECTED
>      </dtml-if> /> <dtml-var brand_name>
> </dtml-in getTable>
>
>
>       
> _______________________________________________
> 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 )
>
>
>   


More information about the Zope mailing list