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

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

问题描述

大家好,我看到了很多问题,但没有一个能满足我的渴望.我想在另一个选择的基础上填充选择.我正在使用 zend 框架.我有一个选择,它将选择一个帐户,并根据所选的 id 我想用基于第一个选择的选项从数据库中获取的值填充其他选择.我先选择是这样的

<前><选择名称='选择1'><option value='1'>accoutn1</option><option value='4'>accoutn4</option>

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

<前><选择名称='客户'>

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

解决方案

如果你使用 jQuery 你可以使用这个 插件

演示和用法显示在此处

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>

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>

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?

解决方案

If you are using jQuery you can use this plugin

Demonstration and usage shown here

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

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