Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2010

    Unanswered: Multiple menu selects each dependent on the one above

    Hi I'm trying to create a simple page with three menu select drop downs, the choices available are dependent upon what was selected in the previous drop down.

    1st display food types,
    the user selects FRUIT

    2nd Displays Fruit types
    the user selects Apples

    3rd displays apple types
    the user selects an apple.

    I have got this working between the first and second menus, by writing a Jquery function to $_POST the select choice through to a php scripted file which generates the html code.

    However it doesn't work between the 2nd and 3rd menus, I believe because the html code for the second drop down is being generated from a separate php file and displayed using javascript. Could someone point me towards how I should tackle this problem or point me towards an example please?

    Thanks for your help, I am currently trying to teach myself basic web development so sorry if I got some terminology wrong!

  2. #2
    Join Date
    Jun 2010
    My opinion is the best way to do this is with Ajax requests in everyone choice.
    What I mean - every time I change Select one Ajax request is sent to the php file which is processed and returned as an answer the data or html to filling the second Select statement.
    Here you are some links for examples:
    Auto-populating Select Boxes using jQuery & AJAX
    Chained select boxes
    Using Ajax to Populate a Select Box in CakePHP - James Fairhurst

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts