aa数据集中的文本框值 [英] textbox values in aa dataset

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

问题描述

我在文本框中输入值时有2个文本框和标签,然后在另一个文本框中自动显示一个值

解决方案

引用:

我在文本框中输入一个文本框和标签,然后在另一个文本框中自动显示一个值你必须为此编码。您需要使用 JavaScript 在客户端处理TextBox的 onchange 事件,或者在服务器端使用C#或其他东西处理。



重要的是你必须处理该事件,只要 TextBox 值发生变化,就会触发该事件。在该事件中,您必须将第一个 TextBox Text 值分配给第二个 TextBox


< asp:textbox id =   TextBox1 onkeyup =   WriteText(); runat =   server >  < /   asp:textbox  >  



< script type =  文本/ JavaScript的> 
function WriteText()
{
var TextBox1 = 文档 .getElementById(TextBox1中);
var Label1 = document .getElementById(Label1);
Label1.innerText = TextBox1.value;
}
< / script>


i have 2 textbox and labels when enters a values in textbox one then automatically shows a value in another textbox

解决方案

Quote:

i have 2 textbox and labels when enters a values in textbox one then automatically shows a value in another textbox

You have to code for that. You need to handle the onchange Event of TextBox either in client side using JavaScript or at server side using C# or something else.

Important thing is that you have to handle that event, which will be fired whenever the TextBox value is changed. Inside that event, you have to assign the Text value of the first TextBox to the second TextBox.


<asp:textbox id="TextBox1" onkeyup="WriteText();" runat="server"></asp:textbox>


<script type="text/javascript">
    function WriteText()
    {
        var TextBox1= document.getElementById(TextBox1);
        var Label1= document.getElementById(Label1);
        Label1.innerText=TextBox1.value;
    }
 </script>


这篇关于aa数据集中的文本框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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