使用JavaScript的绑定下拉框 [英] Binding dropdown box using javascript

查看:74
本文介绍了使用JavaScript的绑定下拉框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有两个下拉框.我的要求是在第一个下拉列表中选择一个特定值,第二个下拉列表中的值应该更改.




I had two dropdown box. My requirement is upon selecting a particular value in first dropdown the values in the second dropdown should change.

推荐答案

只需在Google/CP中搜索级联下拉列表".
您正在寻找的是根据第一个下拉列表中选择的值填充第二个下拉列表.

因此,基于标签MVC,请看以下内容:
XMLHttpRequest [ ^ ]
Just Google/CP Search for ''Cascading Dropdown''.
What you are looking for is populating a second dropdown based on the value selected in first dropdown.

As such, based on tag MVC, have a look at this:
ASP.NET MVC–Cascading Dropdown Lists Tutorial [^]

If you want to use JavaScript, you would need to use XMLHttpRequest (tradition way!): XMLHttpRequest[^]


我想您需要做的就是选择一个下拉列表的值,并相应地将数据填充到第二个中.
在此处查看
I think All You need is Selecting the value of One drop down and accordingly it fills the data in the second one.
Check It Out here


这篇关于使用JavaScript的绑定下拉框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆