在select中选择值时如何将值加载到文本字段 [英] How to load value to text field when choose value in select

查看:78
本文介绍了在select中选择值时如何将值加载到文本字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我有问题需要帮助,我有一个表格有1个选择字段和1个文本字段,我想在选择文本字段的选项中选择值时会加载/显示值与值的比例选择,当我在选择字段中选择B时,图片中的示例,文本字段中的值将显示为1,那么如何操作,我需要示例参考,指导或演示示例,感谢阅读我的主题。

这是图像:

http://i1095.photobucket.com/albums/i472/OLAKEN91/gdf_zpsac464e04.jpg [ ^ ]

Hi every one, I have problem need help that, I have a form have 1 select filed and 1 text field, I want when I choose value in option of select the text field will load/appear value in proportion to value of select, example in picture when I choose "B" in select field, the value in text filed will appear "1", so how to do it, I need example to refer, guide or demo example, Thank for read my topic.
Here is Image:
http://i1095.photobucket.com/albums/i472/OLAKEN91/gdf_zpsac464e04.jpg[^]

<head>
<title>Untitled Document</title>
<style type="text/css">
</style>
</head>
<body>
	<center>
    <br />
    <form id="cv" action="" method="">
    	Choose Option: <select id="chedo">
        <option>--Choose Value--</option>
        <option>A</option>
        <option>B</option>
        <option>C</option>
        </select>
        <br />
        <br />
        Value: <input type="text" id="lenh" size="40"/>
        <br />
        <br />
        <input type="submit" value="SUBMIT"/>
    </form>
    </center>
</body>
</html>

推荐答案

感谢大家的阅读和帮助,这里是代码

thank for read and help of everyone, here is code
<script type="text/javascript" language="javascript">


(#ched)。change(function(){
var selected =
("#chedo").change(function(){ var selected =


(#chedo)。val();
("#chedo").val();


这篇关于在select中选择值时如何将值加载到文本字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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