#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    2
    Rep Power
    0

    dynamic drop down list for CF


    Im trying to get a drop down list to dynamicaly pull distinct categorys from a database to a drop down, any ideas on how to do this?

    Thanks

    Comments on this post

    • Gran Roguismo agrees
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    14
    Rep Power
    0
    Same problem occured with me! Its not working in IE for CE!

    Anyone have a way to over come it?

    Comments on this post

    • Gran Roguismo agrees
  4. #3
  5. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,264
    Rep Power
    968
    Unless I'm missing something, this is really easy to do:

    <cfquery name="myQuery">
    select distinct categoryID, categoryName
    from categories
    </cfquery>

    <form>
    <select name="categoryid" size="1">
    <cfoutput query="myQuery">
    <option value="#myQuery.categoryID#">#myQuery.categoryName#</option>
    </cfoutput>
    </select>
    </form>
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    2
    Rep Power
    0

    thanks


    thank you for your help

IMN logo majestic logo threadwatch logo seochat tools logo