根据从数据库中选择的状态值在下拉列表中填充城市 [英] fill city in dropdown list based on selected value of state from database

查看:58
本文介绍了根据从数据库中选择的状态值在下拉列表中填充城市的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个下拉列表...其中,我首先动态填写国家/地区名称..选择国家/地区下拉列表后,填入州/省....选择国家/地区后,下拉列表中填入对应的城市..state和city的所有值都必须从数据库中填写..

i have one drop down list...in which first i fill country name dynamically..after selecting country drop down list is fill with state....and after selecting state drop down list is filled with corresponding city of state..all the value of state and city are must be filled from database..

推荐答案

它称为 Cascading Dropdown .

看这里:
CascadingDropDown演示 [使用SQL数据库的AJAX级联下拉示例 [ ^ ]
在选择ASP.NET上填充级联DropDownList [面向初学者的AJAX(第2部分)-使用XMLHttpRequest和jQuery AJAX实施级联下拉列表 [ ^ ]
It''s called Cascading Dropdown.

Look here:
CascadingDropDown Demonstration[^]
AJAX Cascading Dropdown Example using SQL Database[^]
Populate Cascading DropDownList On Selection ASP.NET[^]

If not update panels, then you need to use traditional AJAX - XMLHttpRequest.
Refer:
AJAX for beginners (Part 2) - Using XMLHttpRequest and jQuery AJAX to implement a cascading dropdown[^]


这篇关于根据从数据库中选择的状态值在下拉列表中填充城市的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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