6 Replies Latest reply on Jul 12, 2006 6:40 AM by drforbin1970

    Self populating drop down lists.

    Level 7
      Is there any tutorials or information to do a self populating drop down list
      in CF?

      I assume you would have the form post back to its self using a IsDefined for
      each drop down step. Drop Down 1 (DD1) is selected and that posts back to
      the same page and causes the DD2 to run a SQL query based on DD1's choice
      and you repeat the process until the final DD is selected.

      Is this correct and where can I find a good tutorial?

      Thanks

      --
      Wally Kolcz
      Developer / Support


        • 1. Re: Self populating drop down lists.
          Level 7
          Do a search on Google for "related selects in ColdFusion".

          --
          Bryan Ashcraft (remove brain to reply)
          Web Application Developer
          Wright Medical Technologies, Inc.
          ------------------------------------------------------------------
          Macromedia Certified Dreamweaver Developer
          Adobe Community Expert (DW) :: http://www.adobe.com/communities/experts/


          "Wally Kolcz" <wkolcz@projectproofing.com> wrote in message
          news:e7c9hc$g6a$1@forums.macromedia.com...
          > Is there any tutorials or information to do a self populating drop down
          > list in CF?
          >
          > I assume you would have the form post back to its self using a IsDefined
          > for each drop down step. Drop Down 1 (DD1) is selected and that posts back
          > to the same page and causes the DD2 to run a SQL query based on DD1's
          > choice and you repeat the process until the final DD is selected.
          >
          > Is this correct and where can I find a good tutorial?
          >
          > Thanks
          >
          > --
          > Wally Kolcz
          > Developer / Support
          >


          • 2. Re: Self populating drop down lists.
            Level 7
            The yielded a wealth of knowledge. Thanks a ton!!


            • 3. Re: Self populating drop down lists.
              Level 7
              very welcome.

              --
              Bryan Ashcraft (remove brain to reply)
              Web Application Developer
              Wright Medical Technologies, Inc.
              ------------------------------------------------------------------
              Macromedia Certified Dreamweaver Developer
              Adobe Community Expert (DW) :: http://www.adobe.com/communities/experts/


              "Wally Kolcz" <wkolcz@projectproofing.com> wrote in message
              news:e7ch6s$otq$1@forums.macromedia.com...
              > The yielded a wealth of knowledge. Thanks a ton!!
              >


              • 4. Re: Self populating drop down lists.
                drforbin1970 Level 1
                If your record count is not too large, preload data into form and populate selects dynamically using JavaScript.
                • 5. Re: Self populating drop down lists.
                  Level 7
                  Actually, I would like it to simply invoke a cfif that has 2 versions of the
                  drop down menu. One list would have 2 options and the other would have 4.
                  After the first dropdown is selected, the choice from that would invoke the
                  next cfif and it would choose between the two.

                  Something like:

                  <cfif Form.memtype EQ 'sb'>
                  <select name="projects" class="maintext" id="projects">
                  <option selected="selected">Choose One</option>
                  <option value="10">10</option>
                  <option value="Unlimited">Unlimited</option>
                  </select>
                  <cfelse>
                  <select name="projects" class="maintext" id="projects">
                  <option selected="selected">Choose One</option>
                  <option value="10">10</option>
                  <option value="25">25</option>
                  <option value="50">50</option>
                  <option value="Unlimited">Unlimited</option>
                  </select>
                  <cfif>

                  I know that is wrong, but it is the general idea. Is that at all possible. I
                  wouldn't think it would have to be database driven.


                  • 6. Re: Self populating drop down lists.
                    drforbin1970 Level 1
                    I don't think you fully understand how ColdFusion works. ColdFusion is on the server side. You can't 'invoke' the cfif once the page is loaded. CF runs BEFORE the HTML page is loaded. You could use CF to populate the dropdowns and then use JavaScript to provide the functionality you are looking for. Search these forums, this question has been answered before.