javascript中的下拉列表,XML文件中的数据 [英] Dropdown list in javascript, Data from XML file

查看:91
本文介绍了javascript中的下拉列表,XML文件中的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨frnds,


我只想在javascript中创建一个三重下拉列表,因为下拉菜单数据将从XML文件中提取...


请帮我这个.....



先谢谢

Hi frnds,

I just want to create a triple drop down list in javascript, for that drop down menus data is to be extracted from XML file...

pls help me in this.....


Thanks in Advance

推荐答案

到目前为止你有什么代码?


三重下拉列表是什么意思?你的意思是如果你从一个中选择,第二个中出现了一组不同的选项,而根据第二个选择,另一个出现在第三个,例如国家 - >国家 - > city?
What code have you got so far?

What do you mean by a triple dropdown list? Do you mean if you select from one, a different set of options appear in the second and depending on the selection i the second, another set appear in the third, e.g. country --> state --> city?


是的,


与国家相同 - >州 - >城市


直到现在我已经用HTML编写了一个HTML代码来从XML文件中提取数据并在下拉列表中显示所有数据。


现在我可以显示下拉国家/地区列表 - >州 - >城市。


我必须将它们互连,当一个选项在第一个列表中选择时,必须显示相应的状态在第二个列表中,就像第三个列表一样..



先谢谢..
Yes,

Same as Country-->State-->City

Till now i''ve written a code in HTML using javascript to extract the data from XML file and show all the data in drop down lists.

Now iam able to show the drop down lists for country-->state-->City.

I''ve to interlink them, when one option selects in first list, corresponding states have to be display in second list, like that to third list..


Thanks in Advance..


你有两个选择:加载将所有数据一次性加载到数组中或者仅加载您需要的数量并使用Ajax更改依赖列表(通过根据选择检索数据)。


对于第一个选项,请参阅此链接
You have two choices: either load all the data at once into arrays or alternatively load only how much you need and change the dependent lists using Ajax (by retrieving the data depending on the selection).

For the first option, see this link.


这篇关于javascript中的下拉列表,XML文件中的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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