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
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 )
I think you want: <select name="myval"> <dtml-in select_vals> <option value="<dtml-var val1>"><dtml-var val2></option> </dtml-in> </select> where val2 is the one that gets displayed in the select list and val1 is the one that actually gets associated with myval when the form is submitted. Sture Lygren wrote:
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
-- Bruce Elrick, Ph.D. Saltus Technology Consulting Group Cell: (403) 870-4429 Personal: belrick@home.com IBM Certified Specialist Business: belrick@saltus.ab.ca ADSM, AIX Support, RS/6000 SP, HACMP
participants (3)
-
Bruce Elrick -
Jim Sanford -
Sture Lygren