php dropdown menu population

后端 未结 4 1548
广开言路
广开言路 2021-01-01 08:31

I\'m trying to write a php script that will populate a second drop down menu based on the selection of the a primary drop down menu. I would like to use jquery to do all the

4条回答
  •  伪装坚强ぢ
    2021-01-01 09:16

    two different ways:

    • make the first level trigger AJAX queries that return the data needed for the second level
    • write a tree structure with all the needed data for all possible selections, and hide it somewhere in the initial page where your Javascript can read it. Either the finished HTML menus (hide and show as needed) or in a big JSON object in the JS part.

提交回复
热议问题