googlemap api代码在下拉菜单和文本框中 [英] googlemap api code on dropdown and text box

查看:110
本文介绍了googlemap api代码在下拉菜单和文本框中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将下拉框中选定的值输入到文本框中。
我有一个文本框和一个下拉框,其中列出了村名。如果选择被改变,该值应该反映在文本框上。请帮助我。

How to get the value that is selected in the dropdown box to a text box. I have a text box and a drop down box in which village names are listed.If the selection is changed that value should reflect on text box.Please help me.

推荐答案

这是一个Javascript 101问题!我不应该回答,但.... ....

This is a Javascript 101 question! I shouldn't answer but ....

<script type="text/javascript">
function selectChange(val)
{
   document.getElementById("text_id").value = val;
}
</script>
<form>
<input id="text_id" value="" type="text" size="10" />
<br />
<select id="select_id" onChange="selectChange(this.value);">
<option value="">-- Select --</option>
<option value="val1">val1</option>
<option value="val2">val2</option>
<option value="val3">val3</option>
</select>

这篇关于googlemap api代码在下拉菜单和文本框中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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