Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
431 views
in Technique[技术] by (71.8m points)

php - populate select from other select value using 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

If you are using jQuery you can use this plugin

Demonstration and usage shown here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...