6 Replies Latest reply on Jun 4, 2008 10:18 AM by Newsgroup_User

    Populate Form using select box..

    ccrider59
      I know someone has to be doing this but I haven't found them yet. I want my user to select a company from my select box and have the form popultate with its related information... WITHOUT refreshing the page. I looking for examples so if anyone has one I would greatly appreciate it.

      werd...
      Calvin Click
        • 1. Re: Populate Form using select box..
          Level 7
          You are most likely looking for an AJAX solution then? You can't do
          this without some kind of request and response between the client and
          server unless you download all the details for all possible companies
          when the page is first loaded. I presume this is would not be desirable.

          With AJAX or similar techniques you can make behind the scenes request
          and responses to the server for new data upon user actions such as they
          making a choice on a select control. Thus the user does not experience
          a page 'refresh'.

          There are plenty of information, tutorials, blogs, ect out there on AJAX
          and such. Good Hunting.
          • 2. Re: Populate Form using select box..
            MiMiB
            I'd like to do something similar. I have a form with several fields. A user inputs a code into one of the fields, I want to then run a query to look up that code and put the information it finds from a certain table into the next field on the form. Is this possible without submitting the form?
            • 3. Re: Populate Form using select box..
              Level 7
              MiMiB wrote:
              > I'd like to do something similar. I have a form with several fields. A user
              > inputs a code into one of the fields, I want to then run a query to look up
              > that code and put the information it finds from a certain table into the next
              > field on the form. Is this possible without submitting the form?
              >

              No, it is not possible with submitting the form, unless you are able and
              willing to down load all the possible results to the client when the
              page is first downloaded.

              If you do not want the user to experience a 'refresh' you can submit the
              form behind the scenes with something like AJAX or FLEX. But you are
              still working in the realm of HTTP requests and responses. These
              technologies do not change that underlining factor.
              • 4. Re: Populate Form using select box..
                Level 7
                Ian Skinner wrote:
                > No, it is not possible with submitting the form...

                No it is not possible WITHOUT submitting the form ...

                Sometimes I do think I should use the web forum so I could edit my
                posts, but then I remember the experience and decide to live with the
                limitations of newsgroup access.

                • 5. Re: Populate Form using select box..
                  Dan Bracuk Level 5
                  I think you can do it with cold fusion and javascript only. The concept would be.

                  Step 1 - run a query that selects all the data you will need to populate the form fields.

                  Step 2 - convert each query column to a js array.

                  Step 3 - write a js function so that when the nth item is selected in the drop down, the nth item from the other arrays go into the form fields.

                  It's a similar concept to related selects.
                  • 6. Re: Populate Form using select box..
                    Level 7
                    Dan Bracuk wrote:
                    > I think you can do it with cold fusion and javascript only. The concept would
                    > be.
                    >
                    > Step 1 - run a query that selects all the data you will need to populate the
                    > form fields.
                    >
                    > Step 2 - convert each query column to a js array.
                    >
                    > Step 3 - write a js function so that when the nth item is selected in the drop
                    > down, the nth item from the other arrays go into the form fields.
                    >
                    > It's a similar concept to related selects.
                    >

                    This is definitely a possible solution, if it is acceptable to download
                    all those JS arrays.

                    This greatly depends on how large they are and what type of network
                    connections are being used. I.E. one can get away with more for an
                    application running on a corporate intranet with high capacity network
                    connections as apposed to a application that must work acceptably for
                    the poor soul in the backwoods home that still relies on a 56K modem
                    over copper phone lines to access the internet.

                    Yes those people still exist, and sometime applications need to be
                    written with them in mind.