FYI - sometimes people find themselves running the same loop over and over
again in a page. For example if you have a page that lets the user pick 4
or 5 different dates then you might find yourself looping over the days in a
month 4 or 5 times. In times like this it is much faster to run the loop
once and record the results to a string, then use the string in 4 or 5
different places....
+-----------------------------------------------+
Bryan Love
Macromedia Certified Professional
Internet Application Developer
Database Analyst
TeleCommunication Systems
[EMAIL PROTECTED]
+-----------------------------------------------+
"...'If there must be trouble, let it be in my day, that my child may have
peace'..."
- Thomas Paine, The American Crisis
"Let's Roll"
- Todd Beamer, Flight 93
-----Original Message-----
From: Tim Laureska [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 18, 2003 12:25 PM
To: CF-Talk
Subject: days in a month
Hello. I'm trying to simplify the code for a drop down list of total #
of possible days in a month (31). to look something like what I'm using
to display months in a year, which looks like this:
<select name="firstmonth" size="1">
<cfloop index="firstmonth" FROM="1" TO="12">
<cfoutput>
<option value="#firstmonth#">#MonthasString(firstmonth)#
</cfoutput>
</cfloop>
</option>
</select>
I tried the code below but it only returns the number 31 in the drop
down box (I'm not sure this function was meant for this type of thing
anyway):
<select name="firstday">
<cfloop index="firstday" FROM="1" TO="31">
<cfoutput>
<option value="#firstday#">#daysinmonth(firstday)#
</cfoutput>
</cfloop>
</option>
</select>
Tim
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4