<cfselect name="monday" size="1" required="yes">
<cfloop from="0" to="23" index="i">
<option value="#i#"<cfif session.monday EQ i>
selected="selected"</cfif>>#i#</option>
</cfloop>
</cfselect>
On 9/27/06, Richard White <[EMAIL PROTECTED]> wrote:
> 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:254525
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4