4 Replies Latest reply on Mar 23, 2007 6:44 AM by Newsgroup_User

    Using a drop down to populate another drop down using dynamic data

    Level 7
      I know this question probably has been posed a million times...

      I want to make 2 drop down lists. The first is static and have 3 options.

      <select name="type" id="type">
      <option value="1">Dogs</option>
      <option value="2">Cats</option>
      <option value="3">Rabbits</option>
      <option value="4">Small & Furry</option>
      </select>

      When selected, the type needs to be passed to a sql statement:

      <cfquery name="GetABreeds" datasource="request.dsn">
      Select breed, name
      From pets
      where type = #form.type#
      </cfquery>

      And the results (GetABreeds) get used to populate the 2nd drop down.
      <select name="type" id="type">
      <option value="#dombreed#">#name#</option>
      </select>

      Anyone know where I can find how this is done. I found some, but they all
      deal with static arrays.