第一个DropDownList被更改后,如何从数据库加载第二个DropDown列表 [英] How to load second DropDown list from Database after first DropDownList is changed
问题描述
在某些时候,用户需要将数据输入到表单中。
此表单有多个文本字段和
DropDownLists
。 其中一个DDL依赖于其以前的DDL。
发生什么情况是,当用户从第一个DDL中选择一个值时,第二个DDL应该从数据库中加载与第一个DDL的选定值相关的数据。
到目前为止,我只实现了 PHP
和 JS
,(no AJAX
, jQuery
或其他任何东西),以处理我的大部分问题。
我想知道如何选择第一个DDL后的项目,从数据库中填充第二个DDL。
任何帮助将不胜感激。谢谢!
I am building a Web App.
At some point a user needs to input data to a form.
This form has several text fields and DropDownLists
.
One of the DDLs is dependent on its previous DDL. What happens is that when the user selects a value from the first DDL, the second DDL should load data from the database that are related to the selected value of the first DDL.
Up to this point I've implemented only PHP
and JS
, ( no AJAX
, jQuery
or anything else ) for handling most of my problems.
I'd like to know how to populate the 2nd DDL from the database after an item on the first DDL was selected.
Any help would be appreciated. Thank you!
Ajax is your best bet. this will help
这篇关于第一个DropDownList被更改后,如何从数据库加载第二个DropDown列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!