0

我最近接到了与 Invision Power Software 合作的任务。我的工作是创建几个应用程序。第一个需要我创建三个基于 ajax 的字段,其中第二个字段的内容取决于第一个,第三个取决于第三个。

好吧,听起来很复杂。这个怎么样:我需要国家/城市/省,其中城市和省份的列表是根据以前的字段从数据库中动态加载的。

如何创建三个自定义下拉字段,其中动态加载它们的数据(第二个字段取决于第一个,第三个字段取决于第二个)?

4

1 回答 1

1

A general frame:

-You have 3 drop select menus A,B,C

-A is full with values, B and C are empty

-You start by putting an event on A to call a function let's call it builtDropDown()

-builtDropDown(value_selected) places appropriate values to B

-As for values going to B they could be retrieved by ajax or if they are very few the could have been preloaded and kept in a js array

-The same goes for C

This is non-ajax example you could start from: Js 3 different select menus dependend on previous selection

于 2011-10-09T19:39:15.433 回答