On Tuesday 09 January 2001 16:01, Angietel wrote:

> > The following is my selection list, where should i put the <dtml-var
> custcountry> in order to display the selected result.

Ooh... this one hurts.. (o8

You have to put "SELECTED" on the 'option' tag you want to be default.
This means iterating over your list with something like:

<dtml-in CountryList>
  <option <dtml-if "_['sequence-item']==custcountry"> SELECTED</dtml-if> 
value="<dtml-var sequence-item>"><dtml-var sequence-item>

If you don't already have the country list in an object somewhere, I 
recommend adding a "lines" type property to either that object, or an 
appropriate folder, and put them in there.

And remember... if "custcountry" doesn't exist.. this will break... do 
putting a:

<dtml-unless custcountry>
  <dtml-call "REQUEST.set('custcountry',' ')">

at the top of the page won't hurt.

> <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>

8< *snip* >8

>     </select>
> Thank You!

Have a better one,
        Curtis Maloney.

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to