[ic] question about [if] tag

Dan Browning interchange-users@icdevgroup.org
Sun Jul 21 14:31:01 2002


At 05:55 PM 7/19/2002 -0400, you wrote:
>I'm trying to do an [if] comparision inside a query but I guess my [if] tags
>are wrong.
>There's not much docs about [if-sql] tags and the ones that I found on the
>interchange lists didn't work either.  Here's my code below.

Rene got me thinking a little:



><select name="issue_agency" >
>[query sql="SELECT * FROM agency" type=list]

list=1
[list]

>     <option value="[sql-param code]"
>         [if term="sql-param code" op="eq" compare="/[value issue_agency]/"
>] selected [/if]>

Try the code you have below again, but check your quotes like Rene 
recommended (you can use | or ' as well as quotation).

>         [sql-param issue_agency]
>     </option>

[/list]

>[/query]
></select>
>
>
>also found a snippit of code which I changed and didn't work either...
>[set agency_code][value issue_agency][/set]
>[if type=explicit compare="($Scratch->{agency_code} =~ "/[value
>issue_agency/"] selected
>[else] problems! [value issue_agency]  [/else]
>[/if]
>
>I just wanted to print SELECTED on the drop down list.
>Thanks for the help.
>Dennis

Good luck,

+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Dan Browning, Kavod Technologies <db@kavod.com>
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... at least I thought I was dancing, 'til somebody stepped on my hand.
                 -- J. B. White