[英]Populating listbox with a function that gets values from a table
I have 2 listboxes on my web page. 我的网页上有2个列表框。 I want to populate second listbox by a value selected in first list box.
我想通过在第一个列表框中选择的值填充第二个列表框。 When I select an option in firstlistbox it queries a table on my backend and populates the secondlist box based on the results.
当我在firstlistbox中选择一个选项时,它会查询后端的一个表并根据结果填充secondlist框。 I cannot use php script inside a javasript so what should I do?
我不能在javasript内使用php脚本,那该怎么办?
You are asking how create a sub categories list box. 您在问如何创建子类别列表框。 You need create it easily using AJAX.
您需要使用AJAX轻松创建它。
Here are the steps you need to do. 这是您需要执行的步骤。
I found this article for you. 我为您找到了这篇文章。
Hope it helps. 希望能帮助到你。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.