<cfloop from="1" to="23" index="i">
<option value="#i#"<cfif i is var> selected</cfif>>#i#</option>
</cfloop>
Or create a query structure to use in the query attribute of the cfselect
then use the selected attribute
-----Original Message-----
From: Richard White [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 27, 2006 4:36 PM
To: CF-Talk
Subject: cfselect
is there any way in the cfselect form option to dynamically set the value
that is selected. For example, if i have a cfselect drop down box that
allows users to select an hour, of course out of 23, e.g.:
<cfselect name="monday" size="1" required="Yes">
<option value="0" selected>0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
etc...
i dont want to have to do lots of cfif statements e.g:
<cfif session.monday eq "0">
<option value="0" selected="selected">0</option>
<cfelse>
<option value="0">0</option>
</cfif>
etc... for all 23 hours
thanks for any help
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:254528
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4