如何实现lable随文本框的值改变而改变 比如 我有两个文本框 当第二个文本框输入一个数字时 这两个文本框的值加起来赋值给lable 我不要点击按钮实现 也不要Change事件 因为这样只有失去焦点时才会计算 ,有没有其他方法呢?求助!求助!求助!求助!求助!求助! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>无标题页</title> <script type="text/javascript"> function sum() { var t1 = document.getElementById("TextBox1"); var t2 = document.getElementById("TextBox2"); if (isNaN(t1.value)) { t1.value = "0"; } if (isNaN(t2.value)) { t2.value = "0"; } document.getElementById("Label1").innerHTML = parseInt(t1.value) + parseInt(t2.value); } </script></head><body> <form id="form1" runat="server"> <div> <asp:TextBox ID="TextBox1" runat="server" Text="0" onkeyup ="sum()"></asp:TextBox> <asp:TextBox ID="TextBox2" runat="server" Text="0" onkeyup ="sum()" ></asp:TextBox> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> <input id="Text1" type="text" /> </div> </form></body></html> <html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>无标题页</title> <script type="text/javascript"> function sum() { var t1 = document.getElementById("TextBox1"); var t2 = document.getElementById("TextBox2"); if (isNaN(t1.value)) { t1.value = "0"; } if (isNaN(t2.value)) { t2.value = "0"; } document.getElementById("Label1").innerHTML = parseInt(t1.value) + parseInt(t2.value); } </script></head><body> <form id="form1" runat="server"> <div> <asp:TextBox ID="TextBox1" runat="server" Text="0" onkeyup ="sum()"></asp:TextBox> <asp:TextBox ID="TextBox2" runat="server" Text="0" onkeyup ="sum()" ></asp:TextBox> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> </div> </form></body></html> 关于SinaEditor新浪编辑器上传图片,求救求救 asp.net 后台如何获取前台Repeater控件里面的文本框内容 asp.net 事务处理 各位大虾帮帮忙 如何函数调用SqlDataReader,如下 请问getSel[getSel.selectedIndex].innerText如何理解? 如何在数据窗口中得到年龄??? 用window.open打开的子窗口,子窗口关闭时,能实现触发父窗口中的javascript函数代码吗?? 网页过段时间有提示信息是什么意思? 关于连接数据库的问题! 如何将下面这段数据循环存入数据库 这样输出有错吗?
<head runat="server">
<title>无标题页</title>
<script type="text/javascript">
function sum() {
var t1 = document.getElementById("TextBox1");
var t2 = document.getElementById("TextBox2");
if (isNaN(t1.value)) {
t1.value = "0";
}
if (isNaN(t2.value)) {
t2.value = "0";
}
document.getElementById("Label1").innerHTML = parseInt(t1.value) + parseInt(t2.value);
}
</script>
</head><body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server" Text="0" onkeyup ="sum()"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server" Text="0" onkeyup ="sum()" ></asp:TextBox>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<input id="Text1" type="text" /> </div>
</form>
</body>
</html>
<head runat="server">
<title>无标题页</title>
<script type="text/javascript">
function sum() {
var t1 = document.getElementById("TextBox1");
var t2 = document.getElementById("TextBox2");
if (isNaN(t1.value)) {
t1.value = "0";
}
if (isNaN(t2.value)) {
t2.value = "0";
}
document.getElementById("Label1").innerHTML = parseInt(t1.value) + parseInt(t2.value);
}
</script>
</head><body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server" Text="0" onkeyup ="sum()"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server" Text="0" onkeyup ="sum()" ></asp:TextBox>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>