将组合框中的文本复制到文本框中 [英] copy text in combo box to text box

查看:95
本文介绍了将组合框中的文本复制到文本框中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当组合框文本被更改时,我有组合框和文本框,或者离开焦点,然后组合框文本将出现在文本框中。所以我该怎么做呢请帮助我



提前谢谢

i have combo box and text box when combo box text is changed or leave the focus then combobox text will appear in text box. so how can i to do this pls help me

Thanks in advance

推荐答案

试试这个javascript函数: -



Try this javascript function:-

function chkind(){
    var dropdown1 = document.getElementById('dropdown1');
    var textbox = document.getElementById('textbox');
    var selectedText = dropdown1.options[dropdown1.selectedIndex].text;
    textbox.value =selectedText;
}


这篇关于将组合框中的文本复制到文本框中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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