Robert,

Hopefully I am understanding you correctly. After a user has submitted a
form with the states selected you want an admin script to highlight which
have been selected and which haven't. Is this correct? If so how are you
storing the selected value list?

The way I usually save a mutli-select value list is as a varchar field in
some database table. You can then loop through your country list and check
to see if the current country id is in the value list from the other table.
If it is set the <option> to "selected"

Example:
<cfquery name="Options">
SELECT IDList FROM SomeTable
</cfquery>

<cfquery name="Countries">
SELECT ID,CountryName FROM CountriesTable
</cfquery>

<cfloop query="Countries">
<cfoutput>
<option value="#Countires.ID#" <cfif #ListContains(Options.IDList,
"#Countries.ID#")#>selected</cfif>>#CountryName#
</cfoutput>
</cfloop>

Hopefully this is what you were asking about. If not let me know.



Brian Ferrigno

-----Original Message-----
From: Robert Everland [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 27, 2001 12:44 PM
To: CF-Talk
Subject: Easier way to have a drop down selected


        Ok I have this drop down box that lists every country out there, the
problem is after someone has selected it, I want the admin side to show
which one has been selected, while also showing the rest of them. I have
done this but doing a huch cfcase statement that goes from 1 - whatever and
if it is a vertain one selected it sets a number, then the select box has a
cfif in there to see if that number has been turned on. Does anyone have a
simple solution, or is my solution the only way there is.

Robert Everland III
Dixon Ticonderoga

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to