[Zope] ZSQL method variables in a forms select statement - how?

Jim Sanford jsanford@atinucleus.com
Wed, 6 Oct 1999 09:55:58 -0500


Most of my select statement options are also pulled from an sql query
below is a snippet of code from our current in use web based contact system:

<snippet>

<b>Org.:</b> <select name="wi_org_id" size=1>
<option value=0 <dtml-if "i_org_id==0">selected</dtml-if>>???
<dtml-in "Query.Distributors()" sort=descrip>
<dtml-let xorgid="xtagval(note,'Org_ID')">
<option value=<dtml-var xorgid> <dtml-if
"_.string.atoi(xorgid)==i_org_id">selected</dtml-if>><dtml-var descrip>
</dtml-let>
</dtml-in>
</select>

</snippet>

*Note: i_org_id is the field returned by the ZSQL method it is an integer
value in the Visual FoxPro (VFP) table. xtagval is an extermal method that
extracts data from a string (in this case the contents of a VFP memo field).
The data is stored in the string with a simple xml structure.

Jim Sanford
Accelerated Technology, Inc.

----- Original Message -----
From: Sture Lygren <sture@rocketrange.no>
To: <zope@zope.org>
Sent: Wednesday, October 06, 1999 9:24 AM
Subject: [Zope] ZSQL method variables in a forms select statement - how?


> Hi!
>
> My apologies for asking an already answered question?
>
> I've made a form wich has a <select><option> field.
> The <option></option> part gets its data from a zsql method (first of
> two
> variables). My problem is - how can I have the other variable to be the
> one that gets assosiated with the 'name' field in <select>?
>
> Thanks in advance
>
> Sture Lygren
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://www.zope.org/mailman/listinfo/zope
>
> (Related lists - please, no cross posts or HTML encoding!
>
> To receive general Zope announcements, see:
> http://www.zope.org/mailman/listinfo/zope-announce
>
> For developer-specific issues, zope-dev@zope.org -
> http://www.zope.org/mailman/listinfo/zope-dev )
>