How to populate drop down list from one field withdelimiters

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default How to populate drop down list from one field withdelimiters

    Hello

    How can we populate a drop down dynamically from the database by splitting one
    row of data .
    I have data in a field which is seperated by delimiters
    example Shirt, TShirt, Pants as one field data in the DB
    I need to display them individually in a drop down list
    How can this be done

    Thanks

    Anj01 Guest

  2. Similar Questions and Discussions

    1. populate list
      is it possible to populate the list automatically after finish recording the video? in another word, is there anyway i can call the flv files saved...
    2. Dynamic Drop Down and To Populate a Text Field
      Hello, I have a db with urltitle and ulrlink one is for title the other its hyperlink. I have a dynamic list hooked up to title, but I want the url...
    3. How to populate the form fields from another drop down list
      Hello, I would like to populate form fields from one drop down list in the same page. The drop down list's value is from SQL database. When...
    4. dynamically populate drop down menu option value problem
      hi I was wondering if anyone can help me out on this.... I have dynamcally populated a drop down menu with data from an access database using...
    5. Access auto fill/populate field with list of different values
      I am creating a database with the following fields in the table ID - ID Number for person LAB - Lab Name LABDT - Lab date LABVAL - Value of the...
  3. #2

    Default Re: How to populate drop down list from one field withdelimiters

    You just loop over the list to create the options:

    <select name="MyField">
    <cfloop list="#DataField#" index="ItemField">
    <cfoutput><option value="#ItemField#">#ItemField#</option></cfoutput>
    </cfloop>
    <select>

    TA-Selene Guest

  4. #3

    Default Re: How to populate drop down list from one field withdelimiters

    thanks

    but the datafield has data in 1 cell itself seperated by ,
    how do i populate that into the drop down. The method you have specified will
    put the data in drop down list if it in different rows

    thanks

    Anj01 Guest

  5. #4

    Default Re: How to populate drop down list from one field withdelimiters

    Not really. If you replace DataField with the name of your column, this code will loop over the contents (which is really a list) and create an option for each element of that list.
    TA-Selene Guest

  6. #5

    Default Re: How to populate drop down list from one field withdelimiters

    Thanks a lot Selene it works gr8
    Anj01 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