选择下拉列表时,在文本框中获取相应的值 [英] get corresponding values in textbox while selecting dropdown list

查看:90
本文介绍了选择下拉列表时,在文本框中获取相应的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何根据选择下拉列表在文本框中设置值?例如,在xml文件中存储了员工详细信息jsp页面包含一个包含所有员工ID的下拉列表。当我选择任何员工ID时相应文本框中的员工详细信息..但没有任何按钮点击..我正在使用jsp&servlet

How do I set value in textbox according to select the dropdown list?for example There are stored employee details in a xml file a jsp page contains a dropdown list which contains all employee id.when I will select any employee id there will the employee details in corresponding text boxes..but without any button click..I am using jsp & servlet

推荐答案

继续使用On Change事件下拉列表从中您将获得所选值,因此可以根据选择在相应字段中显示详细信息
Go on by using "On Change" Event of dropdownlist from which you will get the selected value and hence can display details in the respective fields based on the selection


在下面浏览以获取想法,并尝试提供代码。



使用JavaScript处理下拉列表选择 [ ^ ]



http://www.plus2net.com/javascript_tutorial/listbox-onchange.php [ ^ ]
Explore below for ideas and please try to come up with a code .

Using JavaScript to handle drop-down list selections[^]

http://www.plus2net.com/javascript_tutorial/listbox-onchange.php[^]


这篇关于选择下拉列表时,在文本框中获取相应的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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