<cfloop index="i" from="1" to="99">
        
<option value="#NumberFormat( i, "00" )#"
<cfif (Val( qry.xox ) EQ i)>selected="true"</cfif>
>#NumberFormat( i, "00" )#</option>

</cfloop> 


......................
Ben Nadel
Certified Advanced ColdFusion MX7 Developer
www.bennadel.com
 
Need ColdFusion Help?
www.bennadel.com/ask-ben/

-----Original Message-----
From: Les Mizzell [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 22, 2007 10:07 AM
To: CF-Talk
Subject: A Loop, A Number Format, and a Select

Select currently looks like this:

<select name=xox">
  <option value="00"
          <cfif qry.xox EQ 00> selected="selected"</cfif>>00</option>
  <option value="01"
          <cfif qry.xox EQ 01> selected="selected"</cfif>>01</option>
  <option value="02"
          <cfif qry.xox EQ 02> selected="selected"</cfif>>02</option>

  ...up to whatever number
</select>

Gotta be a better way using a loop, and if the numbers were simply 1
through whatever, no problem. It's keeping the leading zero and starting
with "00" and then "01", "02", ... , whatever that's making me scratch
my head.

The database field is a varCHAR so no problem there.

Ideas?



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:270442
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