> I am populating a select input field with a <cfloop>
>
> <select name="parked">
> <option value="">
> <cfloop index=i from="1" to="52">
> <option value="#i# week/year">#i# week/year
> </cfloop>
> </select>
>
> That's all working. This form is also an edit form if a record already
> exists for this facility. How do I pre-select the value that is in the
> database for that record from within the loop?
Putting "selected" into an option makes it the default option, so;
<option value=1 selected>
would appear in the browser
For your code, you'd have to do an if or #iif to add in the "selected";
<option value="#i# week/year" #iif(parked is "#i#
week/year",de("selected"),de(""))#>#i# week/year
HTH
Philip Arnold
ASP Multimedia Limited
T: +44 (0)20 8680 1133
"Websites for the real world"
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.