[Zope] Select Box Problem

Jim Sanford jsanford@atinucleus.com
Tue, 20 Jun 2000 16:25:40 -0500


Piece of cake - here it is: (I have structured it to be easy to read.)

This code assumes that the variable customerid on the form
contains a value that matches up with customerid in 
custcompanysearch

_______________________________________
<dtml-let tcustid="customerid">
  <select name="customerid">
    <dtml-in custcompanysearch>
      <option value=<dtml-var customerid>
      <dtml-if "customerid==tcustid">selected</dtml-if>>
      <dtml-var firstname> <dtml-var lastname></option>
    </dtml-in>
  </select>
<dtml-let>
 _______________________________________
 
              Jim Sanford
      .       Database Engineer
     / \  /   Accelerated Technology, Inc.
    /   /     720 Oak Circle Drive East
   /  /  \    Mobile, AL 36609
  / /     \   Voice: 334-661-5770  fax: 334-661-5788
 /         \  E-Mail: jsanford@atinucleus.com
              Web: http://www.atinucleus.com
  
 Nucleus.  All You NEED in an RTOS.  Royalty Free
 _______________________________________

----- Original Message ----- 
From: Kenny Flegal <soulstompp@hotmail.com>
To: <zope@zope.org>
Sent: Tuesday, June 20, 2000 3:24 PM
Subject: [Zope] Select Box Problem


I have a form that pulls back previous order information from a customer. 
This form has a select box for with a list of customers in the database so 
that a user can easily select who made the order. Everything in this form 
works fine except for the select box. The select box shows the option at the 
top of the list everytime. This is not what I am looking for however, I need 
the select box to reflect what the customer that placed the order. I could 
easily do this with the select except for the fact that the select 
information is dynamically filled by a query. The following code is used.

<select name="customerid"><dtml-in custcompanysearch><option value=<dtml-var 
customerid>><dtml-var firstname> <dtml-var lastname></dtml-in></select>

The entire form is in a <dtml-in> that has a customerid value. I would like 
to have the current customer show up in this box. How would I tell the 
select box to select the current custoemer as default?
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


_______________________________________________
Zope maillist  -  Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )