Ask a Question related to Coldfusion Database Access, Design and Development.
-
criticalelement #1
eliminating like items in dynamically loaded list boxes
Hello- I am currently learning coldfusion and I have just connected to a MS
Access database and I have created some dynamically loaded list boxes. One
field has multiple items that are identical. I wish to eliminate the repetition
of this field, how would I do this?
criticalelement Guest
-
JavaScript: html list items within list items?
Hi, I've seen how to implement a JavaScript to change the CSS class of every other list item in an unordered list, but, being new to JavaScript,... -
Dynamically loaded text file
When a page is uploaded in Contribute 3, it also uploads dependent files attached to it: images, pdf's, etc. My question is, does it also upload... -
Need help persisting a dynamically loaded userControl...
Ok, I've done quite a bit of testing and am stuck. Here's the situation, I have two userControls and my webForm page. menu.ascx - menu... -
Eliminating repeat calls from a list
Hi, I am a student working on a childrens game. The concept is a spelling bee. A picture pops up, a voice speaks the word, and there is a field to... -
Dynamically loaded mp3 into Flash, then into Director?
Rather than dynamically loading the MP3 into Director, I dynamically load the MP3 via Flash. Basically Director is being used as a wrapper for my... -
rmorgan #2
Re: eliminating like items in dynamically loaded listboxes
My first suggestion would be to us 'SELECT DISTINCT' in your query that populates your field.
rmorgan Guest
-
JaredJBlackburn #3
Re: eliminating like items in dynamically loaded listboxes
As mentioned, the 'SELECT DISTINCT' in the SQL in your <cfquery> is probably
the best way, assuming your dynamic list is coming from a database and that you
have access and the ability to change the SQL that's being used. If not,
consider creating an empty cf list. Then when looping through your list, check
to make sure that each item is not in the list, then add it to the cf list and
to your html list box. When you get to a duplicate entry, it will show up in
your list and you will know not to add it to you html list box. It would look
something like this:
<cfset optionList = "">
<cfloop over some kind of list with varable i>
<cfif listFind(optionList, i) is 0>
<option> #i#
<cfset listAppend(optionList, #i#)>
</cfif>
</cfloop>
JaredJBlackburn Guest
-
drforbin1970 #4
Re: eliminating like items in dynamically loaded listboxes
If you cannot modify the SQL code, use the 'group' or 'groupCaseSensitive' attribute of CFOUTPUT:
<cfoutput query="myQuery" group="column_with_dups">
list box
</cfoutput>
drforbin1970 Guest



Reply With Quote

