[Zope] How to retrieve the selection list

Diny van der Donk d.a.vanderdonk@vet.uu.nl
Tue, 09 Jan 2001 07:49:33 +0100


At 13:01 9-1-01 +0800, Angietel wrote:
>The following is my selection list, where should i put the <dtml-var
>custcountry> in order to display the selected result.
>  
You don't have to, as soon as one option is selected you're variable
custcountry gets the value from <option value="Canada"> and the text
between <option value="Canada"> and </option> is being displayed.

<option value="Canada">Canada</option>
                ^         ^

If you have you're countries in a database you can let sql generate an
option list in stead of typing all the options. Something like this:

<select name="custcountry">
  <dtml-in "select_country(REQUEST)">
  <option value='<dtml-var country_field>'><dtml-var country_field></option>
  </dtml-in>
</select>

Where select_country is a sql-method like:

select
country_field
from COUNTRY

Regards,

Diny


><select name="custcountry" size="1" tabindex="9" style="HEIGHT: 22px;
WIDTH: >293px">
>    
>            <option value="....."selected>Please select a country</option>
>  
><option value="Australia">Australia</option>
><option value="Cambodia">Cambodia</option>
><option value="Canada">Canada</option>
><option value="China">China</option>
><option value="Colombia">Colombia</option>
>[...]
><option value="United States">United States</option>
>    </select>
>Thank You!
>


DIVA, Faculty of Veterinary Medicine
Utrecht University,  The Netherlands
http://www.vet.uu.nl