Professional Web Applications Themes

dynamic drop downs - Macromedia ColdFusion

hey everyone. i'm making a site that uses drop down menus. their content changes depending on where the user is in the site. i have a table set up in my database that contains the info that will be in the drop downs. can i query the datasource and have the records from the table display in my drop down list? i also have a field in the table with a webpage; can i use that to correspond to the record displayed? hope this makes sense. i tried it once and got it, but it only displays one record. thanks ...

  1. #1

    Default dynamic drop downs

    hey everyone. i'm making a site that uses drop down menus. their content
    changes depending on where the user is in the site. i have a table set up in my
    database that contains the info that will be in the drop downs. can i query the
    datasource and have the records from the table display in my drop down list? i
    also have a field in the table with a webpage; can i use that to correspond to
    the record displayed? hope this makes sense. i tried it once and got it, but it
    only displays one record. thanks to anyone who can help!

    straffenp Guest

  2. #2

    Default Re: dynamic drop downs

    On 2005-06-20 20:26:03 -0500, "straffenp" <webforumsusermacromedia.com> said:
    > hey everyone. i'm making a site that uses drop down menus. their
    > content changes depending on where the user is in the site. i have a
    > table set up in my database that contains the info that will be in the
    > drop downs. can i query the datasource and have the records from the
    > table display in my drop down list? i also have a field in the table
    > with a webpage; can i use that to correspond to the record displayed?
    > hope this makes sense. i tried it once and got it, but it only displays
    > one record. thanks to anyone who can help!
    This is all quite possible and very simple. Concerning the drop-down
    you can either just loop through the query to create the options, for
    example:

    <select name="myDynamicSelect">
    <cfoutput query="myQuery">
    <option value="#id#">#value#</option>
    </cfoutput>
    </select>

    #id# and #value# above would be the names of the database fields you
    want to use for these elements.

    Or you can use cfselect inside a cfform and use the query attribute:
    <cfform name="myForm">
    <cfselect name="mySelect" query="myQuery"
    value="database_field_with_value"
    display="database_field_with_display_content" />
    </cfform>

    Hope that helps,
    Matt
    --
    Matt Woodward
    [email]mpwoodward[/email]
    Team Macromedia - ColdFusion

    mpwoodward *TMM* Guest

Similar Threads

  1. Drop Downs and Embed tag
    By roach62 in forum Macromedia Dynamic HTML
    Replies: 7
    Last Post: December 7th, 01:29 PM
  2. add drop downs to a php file
    By verynew2it in forum Macromedia Dynamic HTML
    Replies: 0
    Last Post: January 21st, 07:00 PM
  3. Streamlining Drop-Downs
    By Magnim in forum Coldfusion Flash Integration
    Replies: 2
    Last Post: November 11th, 01:29 AM
  4. drop downs not working.....
    By skowhegan in forum Macromedia Dynamic HTML
    Replies: 0
    Last Post: August 18th, 07:32 PM
  5. Drop Downs
    By GRANADESIGN in forum Macromedia Flash Actionscript
    Replies: 1
    Last Post: February 20th, 08:34 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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