Best way to have options pre selected?

Author Message

Gabriel Ambuehl

Saturday 03 May 2003 7:41:08 am

I was wondering how one goes best about adding the selected attribute to individual <option> elements based on the content of a variable.

switch seems not to work, as it will strip away everything outside the {case} {/case} elements and having an entirely different option box for each case of the switch is rather ugly and hard to change when you decide to change some option.

Ideally, I'd want something like
<option {if $myvalue=a>a</option>
<option {if $myvalue=b>b</option>

The eq operator seems of no use either as it will return true, not some arbitrary element of text...

Visit http://triligon.org

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.