Social Engine Zend Framework - 国家/州/城市的动态 Ajax 下拉菜单
我正在使用基于 Zend Framework 和 Smarty Template 的 Social Engine。
我需要为个人资料页面创建自定义功能,其中我需要基于 Ajax 的动态国家/州/城市选择,例如
国家下拉菜单 ->选择某个国家时,State 将显示属于所选国家和 State 选择 ->将显示相关城市。我的国家/州和城市有单独的表格。
任何人都可以帮助我们或者可以提供一些参考/示例吗?
我不知道如何进行 Ajax 调用并用它呈现我的视图!
问候 !
I am working with Social Engine which is based on Zend Framework and Smarty Templates.
I need to make custom functionality for profile page, where I need Ajax based Dynamic Country / State / City selections like
Dropdown for Country -> on selection of some country, State will display belonging to selected country and State selection -> related Cities will display. I have separate tables for my country/state and city.
Anybody can help us or can provide some reference / examples for the same?
I don't know, how to make Ajax calls and render my views with this !
Regards !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅下面的代码:
给出我的项目加载段、船舶类型子段的代码。与国家/地区相同,状态
首先像往常一样使父下拉菜单如下:
这里arrInput ['shiptype']来自controllar
为您表单上的子下拉菜单创建一个div
现在将jquery代码放在您的表单上:
现在为子下拉菜单您的控制器执行一个操作:
现在为上述操作创建一个视图:
使用 html 使 html 下拉(子)从子段控制器获取数据
,请参阅段 = 国家/地区
subseg = 城市的州
遵循相同的操作并再次查看和 jquery 代码。
如果不清楚,您可以随时询问。我有这个任务。这很棘手:)
See code below:
giving code from my project loads segment, sub-segments of ship type. same as country ,state
first make parent drop down as usual like this :
here arrInput['shiptype'] is from controllar
make a div for child drop down on ur form
Now put below jquery code on ur form:
now for child drop dowm in yor controllar make a action :
now make a view for above action:
make html drop down (child) using html take data from subseg controller
here refer segment = country
subseg = state
for city follow same make a action and view and jquery code again.
If not clear u are free to ask. I have donw this task. It's tricky :)