使用jquery填充从其他选择值中选择 [英] populate select from other select value using jquery

查看:126
本文介绍了使用jquery填充从其他选择值中选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家都看到很多问题,但没有人满足我的渴望。我想在另一个选择的基础上填充选择。我正在使用zend框架。我有一个选择将选择一个帐户,并根据所选的ID,我想填充其他选择与基于第一个选定的选项从数据库中提取的值。我首先选择的是这样的

hi all I have seen many question but no one has fulfilled my thirst. I want to populate select on the basis of one other select. I am using zend framework. I have a select that will select a account and on the basis of that selected id i want to populate other select with values fetched from database based on first selected option. I have first select which is like this


<select name='select1'>
<option value='1'>accoutn1</option>
<option value='2'>accoutn2</option>
<option value='3'>accoutn3</option>
<option value='4'>accoutn4</option>
</select>

现在我想要的是基于什么第一个选择,另一个选择使用jquery填充。选项将是基于第一个选定值从数据库中获取的值。我的其他选择是

Now what I want that on the basis of first select, the other other select is populated using jquery. The options will be values fetched from database on the basis of first selected value. my other select is


<select name='client'>
</select>

jquery的哪个函数支持这一点,我可以在所选选项的基础上从数据库中获取值并填充其他select。我正在使用zendframe工作。任何的想法?

Which function of jquery supports this that I can fetched values from database on the basisi of selected option and populate other select. I am using zendframe work. Any idea?

推荐答案

如果您使用的是jQuery,可以使用插件

If you are using jQuery you can use this plugin

演示和使用显示这里

这篇关于使用jquery填充从其他选择值中选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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