Cascading Dropdown List

后端 未结 2 2206
天命终不由人
天命终不由人 2021-01-22 00:01

I am working on a web app and trying to code a form with two dropdown lists. The list in the second dropdown will be dependent on the selection from the first one. The task it

2条回答
  •  难免孤独
    2021-01-22 00:25

    you will have to use a combination of Ajax and javascript here. Onchange event of your select drop down call a javascript function. This javascript function will make a ajax request to a python script that will actually make a database hit and return you a response in a javascript variable. With this javascript variable you can edit you DOM and set the html of second select box.

    see if u can get some hint from this: http://www.satya-weblog.com/2007/04/dynamically-populate-select-list-by.html

提交回复
热议问题