Oops... forgot a closing bracket after the </cfif>
You could also make a variable out of the high number to genericize the right() 
function

<cfset myTo = 1200000>
<cfloop from="1" to="#myTo" index="ii">
        <cfset s_ii = right("000000000000000"&ii,len(myTo))>
        <option value="#s_ii#" <cfif qry.xox eq s_ii>selected="selected"</cfif> 
> #s_ii#</option>
</cfloop>


At 10:49 AM 2/22/2007, you wrote:
>How about
>
><cfloop from="1" to="12000" index="ii">
>        <cfset s_ii = right("0000"&ii,5)>
>        <option value="#s_ii#" <cfif qry.xox eq 
> s_ii>selected="selected"</cfif> #s_ii#</option>
></cfloop>
>
>Mik
>
>
>At 10:06 AM 2/22/2007, you wrote:
>>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?
>>
>>
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
The most significant release in over 10 years. Upgrade & see new features.
http://www.adobe.com/products/coldfusion

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:270460
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to