PHP MYSQL dynamic select box

后端 未结 4 826
囚心锁ツ
囚心锁ツ 2021-01-16 12:14

I am trying to create a search box where the option selected from \'box1\' populates the options available for \'box2\'. The options for both boxes are given from my MYSQL d

4条回答
  •  清歌不尽
    2021-01-16 12:23

    maybe you can create a javascript two-dimensional array that save the relations school to products. And when select a shool name, you can get the products list by the school name as the key in the array, and update the box2's options list.

    Maybe you can echo a js string like this:

    
    

    thanks

提交回复
热议问题