6 dropdown boxes populated from PHP/MySQL using Ajax

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hdf
    New Member
    • Jan 2007
    • 24

    6 dropdown boxes populated from PHP/MySQL using Ajax

    hi
    i want to use a dropdown box to populate another dropdownbox and so on but i want to maitain all the data adt was selected from d previoce box and i dnt want to make use of submit button but the dropdown must triger the changes assoon as its value gange

    can anyone hlp
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Ever thought of using JavaScript for that? Certainly not PHP.

    Ronald :cool:

    Comment

    • hdf
      New Member
      • Jan 2007
      • 24

      #3
      Originally posted by ronverdonk
      Ever thought of using JavaScript for that? Certainly not PHP.

      Ronald :cool:
      hi how can i go about doing dat

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        Where do you want your dropdown box to be populated from?

        From data that is stored in your program or from a server database?

        That makes a big difference, because in the first case you simply trigger a JS routine that fills another box.

        In the second case you let the triggered JS routine make contact with the server to get the data (using Ajax) and then let that populate the next dropdown.

        For both options is a solution.

        Ronald :cool:

        Comment

        • hdf
          New Member
          • Jan 2007
          • 24

          #5
          Originally posted by ronverdonk
          Where do you want your dropdown box to be populated from?

          From data that is stored in your program or from a server database?

          That makes a big difference, because in the first case you simply trigger a JS routine that fills another box.

          In the second case you let the triggered JS routine make contact with the server to get the data (using Ajax) and then let that populate the next dropdown.

          For both options is a solution.

          Ronald :cool:
          i want it to read from the database

          Comment

          • ronverdonk
            Recognized Expert Specialist
            • Jul 2006
            • 4259

            #6
            In order to understand the process of Ajax, see demo's named Dynamic client lookup and Chained select boxes at site Ajax scripts

            The first one uses the server database top get the info. The second fills a drop down.

            When you have questions left, come back here.

            Ronald :cool:

            Comment

            • hdf
              New Member
              • Jan 2007
              • 24

              #7
              Originally posted by ronverdonk
              In order to understand the process of Ajax, see demo's named Dynamic client lookup and Chained select boxes at site Ajax scripts

              The first one uses the server database top get the info. The second fills a drop down.

              When you have questions left, come back here.

              Ronald :cool:
              hi how do i link up 5 dropdown boxs to eachother.e.g
              dropdown1 i select the value and it populate dropdown2 dan i select from dropdown2 and it poulates dropdown3 ans son

              how can it b done and it must contain the selection tru outh the proces

              Thank you

              Comment

              • ronverdonk
                Recognized Expert Specialist
                • Jul 2006
                • 4259

                #8
                I have (very simple) sample scripts for this. Although it is not my habit of making complete code sets available, I will make an exception in this case because it would be a never ending thread to display and comment the code involved.

                I have sample code whereby 6 drop-down boxes are filled, each one depending on the choice in the previous one. The data to populate these boxes is coming from a MySQL database.

                The code for this contains 3 simple scripts:
                1. client script building the screen and executing the JS requests to the server
                2. a PHP program that is invoked by the client JS. It performs the required MySQL selects, builds the fileld dropdown box and sends the result back to the client.
                3. the Ajax.js include lib (Simple AJAX Code Kit (SACK)), used for handling the httpRequests, which is not developed by me, but by Gregory Wild-Smith, under a modified MIT license.

                When you are interested in this code I will send it to the email address of anyone interested. In that case send me your email address.

                Ronald :cool:

                Comment

                • acoder
                  Recognized Expert MVP
                  • Nov 2006
                  • 16032

                  #9
                  Why not just include an attachment (in a zip file) instead of having to email everyone who asks for it?

                  Comment

                  • javaram
                    New Member
                    • Feb 2007
                    • 3

                    #10
                    roven. i need the code.



                    javaram



                    Originally posted by ronverdonk
                    I have (very simple) sample scripts for this. Although it is not my habit of making complete code sets available, I will make an exception in this case because it would be a never ending thread to display and comment the code involved.

                    I have sample code whereby 6 drop-down boxes are filled, each one depending on the choice in the previous one. The data to populate these boxes is coming from a MySQL database.

                    The code for this contains 3 simple scripts:
                    1. client script building the screen and executing the JS requests to the server
                    2. a PHP program that is invoked by the client JS. It performs the required MySQL selects, builds the fileld dropdown box and sends the result back to the client.
                    3. the Ajax.js include lib (Simple AJAX Code Kit (SACK)), used for handling the httpRequests, which is not developed by me, but by Gregory Wild-Smith, under a modified MIT license.

                    When you are interested in this code I will send it to the email address of anyone interested. In that case send me your email address.

                    Ronald :cool:

                    Comment

                    • hdf
                      New Member
                      • Jan 2007
                      • 24

                      #11
                      Originally posted by ronverdonk
                      I have (very simple) sample scripts for this. Although it is not my habit of making complete code sets available, I will make an exception in this case because it would be a never ending thread to display and comment the code involved.

                      I have sample code whereby 6 drop-down boxes are filled, each one depending on the choice in the previous one. The data to populate these boxes is coming from a MySQL database.

                      The code for this contains 3 simple scripts:
                      1. client script building the screen and executing the JS requests to the server
                      2. a PHP program that is invoked by the client JS. It performs the required MySQL selects, builds the fileld dropdown box and sends the result back to the client.
                      3. the Ajax.js include lib (Simple AJAX Code Kit (SACK)), used for handling the httpRequests, which is not developed by me, but by Gregory Wild-Smith, under a modified MIT license.

                      When you are interested in this code I will send it to the email address of anyone interested. In that case send me your email address.

                      Ronald :cool:
                      hi
                      is send u the pm n waiting for the code thnx

                      Comment

                      • aniltc
                        New Member
                        • Jul 2006
                        • 17

                        #12
                        hi all

                        i need the code for 6 drop down list box using AJAX.I have done something similar to this using 3 drop downe.But values are not retaining.pleas e help me out and please show me some examples.

                        Thanks

                        Comment

                        • ronverdonk
                          Recognized Expert Specialist
                          • Jul 2006
                          • 4259

                          #13
                          then pm your email address.

                          Ronald :cool:

                          Comment

                          • aniltc
                            New Member
                            • Jul 2006
                            • 17

                            #14
                            Originally posted by ronverdonk
                            then pm your email address.

                            Ronald :cool:
                            I have send it.But the code you have given look like jung values.I am not able to read.please send me once more as a Zip file or Rar files

                            Thanks and Regards
                            ANIL

                            Comment

                            • aniltc
                              New Member
                              • Jul 2006
                              • 17

                              #15
                              you have send the code twice But i am not able to raed it.which alnguage is this?
                              please help me.i am in a deep trouble

                              Comment

                              Working...