eliminating like items in dynamically loaded list boxes

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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,...
    2. 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...
    3. 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...
    4. 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...
    5. 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...
  3. #2

    Default 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

  4. #3

    Default 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

  5. #4

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139