I prefer:
<select>
<cfif value eq url.value>
<cfset selected = "selected">
<cfelse>
<cfset selected = "">
</cfif>
<option value="#value#" #selected#>
#text#
</option>
</select>
> -----Original Message-----
> From: Mingo Hagen [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 11, 2006 10:28 AM
> To: CF-Talk
> Subject: Re: CFIF inside a Form
>
> Which is more readable is quite subjective, you probably find this more
> readable:
> <select>
> <option value="#value#"<cfif value eq url.value>
> selected</cfif>>#text#</option>
> </select>
>
> And I this:
> <select>
> <option value="#value#"#iif( value eq url.value, de( ' selected' ),
> de( '' ))#>#text#</option>
> </select>
>
> Partly because homesite+ screws up the color coding and partly because i
> don't like tags inside of tags (even if it's to different languages)
>
> Anyways, I call potayto/potahto. Also I remember reading that iif() is
> actually faster in certain cases, but I forgot why when or how
> (something to do with the Java translation) but thats probably nullified
> by the delayed expressions...
>
> An even better way for the above example would be to put the ' selected'
> into a separate variable alongside the #value# and #text#
> Mingo.
>
> loathe wrote:
> > Honestly, I almost wish that Adobe would do away with iif and evaluate.
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:249579
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4