文本框获取下拉菜单选中项的值

4个月前 (05-10 16:11)阅读回复0
大陆
大陆
  • 管理员
  • 发消息
  • 注册排名1
  • 经验值5294
  • 级别管理员
  • 主题1058
  • 回复2
楼主

通过js脚本来实现了文本框获取下拉菜单选项的值,用户只需要选好下拉菜单选项,该选项所对应的值自动添加到文本框内,实用js脚本代码。

<a href="https://www.wuming.ren">武鸣人</a>,各种信息资源免费发布,分享励志语录经典短句,减肥健身常识,各种js特效代码。网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)<hr>
<!--欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。-->
<script type="text/javascript" src="https://www.wuming.ren/ad/tc.js"></script>
<script type="text/javascript" src="https://www.wuming.ren/ad/a.js"></script>
<p align="center">
<script language="JavaScript">
<!--
function ShowToText(){
document.www_wuming_ren.textfield_name1.value=document.www_wuming_ren.wuming_ren.value
document.www_wuming_ren.textfield_name2.value=document.www_wuming_ren.wuming_ren.options[document.www_wuming_ren.wuming_ren.selectedIndex].text
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
//-->
</script>
<form name="www_wuming_ren" >
<input type="text" name="textfield_name1" style="width: 30">
<input type="text" name="textfield_name2" style="width: 100">
<select name="wuming_ren"   onChange="ShowToText(); "  >
  <option value="1">武鸣人一号  </option>
  <option value="2">武鸣人二号  </option>
  <option value="3">武鸣人三号  </option>
  <option value="4">武鸣人四号  </option>
  <option value="5">武鸣人五号  </option>
</select>
</form>
</p>


0
0
收藏0

本文来自武鸣人网站,转载请注明出处

本文地址:https://www.wuming.ren/a/958.html

回帖

文本框获取下拉菜单选中项的值 期待您的回复!

取消
载入表情清单……
载入颜色清单……
插入网络图片

取消确定

图片上传中
编辑器信息
提示信息