<cfscript>
  myQuery = queryNew( "value,text,selected" );
  queryAddRow( myQuery, 2 );

  querySetCell( myQuery, value, 1, 1 );
  querySetCell( myQuery, value, "my item", 1 );
  querySetCell( myQuery, value, "", 1 );

  querySetCell( myQuery, value, 1, 2 );
  querySetCell( myQuery, value, "my item", 2 );
  querySetCell( myQuery, value, " selected", 2 ); 
</cfscript>

<select>
  <cfoutput query="myQuery">
        <!--- conditional logic inside the loop --->
        <cfset selected = "">
        <cfif myQuery.selected is "selected">
                <cfset selected = "selected">
        <cfif>
        <option value="#value#"#selected#>#text#</option>
  </cfoutput>
</select>

Or throw the cfelse in there if you want to make it even more explicit.  I
don't like implicit code.  I want it to be very easy to understand.  I know
two years from now I am not going to remember some line of code I wrote and
why.


> -----Original Message-----
> From: Mingo Hagen [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 11, 2006 11:16 AM
> To: CF-Talk
> Subject: Re: CFIF inside a Form
> 
> Tom Chiverton wrote:
> > Well, I'd lay out nicer:
> >



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:249598
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to