本文介绍了在Repeater中使用onkeyup功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在转发器中使用onkeyup功能我试过很多但是无法解决我用过的问题



< asp:Repeater ID =RepItemrunat =服务器>

< asp:TextBox ID =TextBox1runat =serverOnKeyUp =GoToNextTextBox(this,event); return false;>

$ / b $ b $ / b
< asp:标签ID =lblGrossrunat =serverText ='<%#Eval( appGrossWt)%>'>



< asp:TextBox ID =txtUsedonkeyup =sumCalc(); runat =server>

< asp:TextBox ID =TxtReturnonkeyup =sumCalc(); runat =server>

< asp:TextBox ID =Txtbalonkeyup =sumCalc(); runat =server>



< script language =javascripttype =text / javascript>



函数sumCalc(){

var _lblGross = document.getElementsByTagName(input)[0];

var _txtUsed = document.getElementById(' <%= txtUsed.ClientID%>');

var _TxtReturn = document.getElementById('<%= txtReturn.ClientID%>');

var _Txtbal = document.getElementById('<%= txtbal.ClientID%>');

var t1 = 0,t2 = 0,t3 = 0;



if(_txtUsed.value!=)t1 = _TextBox1.value;

if(_TxtReturn.value!=)t2 = _TextBox2.value;

if(_lblGross.toString!=)t3 = _lblGross.toString;





_Txtbal.value = parseInt(t3) - parseInt(t1) - parseInt(t2);



}

< / script>







i我试图在文本框中输入任何数字cal应该与...保持平衡在第二个按照onkeyup函数

i am use onkeyup function in repeater i tried lot but could not work it out i used

<asp:Repeater ID="RepItem" runat="server" >
<asp:TextBox ID="TextBox1" runat="server" OnKeyUp="GoToNextTextBox(this, event); return false;">



<asp:Label ID="lblGross" runat="server" Text='<%# Eval("appGrossWt")%>'>

<asp:TextBox ID="txtUsed" onkeyup="sumCalc();" runat="server">
<asp:TextBox ID="TxtReturn" onkeyup="sumCalc();" runat="server">
<asp:TextBox ID="Txtbal" onkeyup="sumCalc();" runat="server">

<script language="javascript" type="text/javascript">

function sumCalc() {
var _lblGross = document.getElementsByTagName("input")[0];
var _txtUsed = document.getElementById('<%= txtUsed.ClientID %>');
var _TxtReturn = document.getElementById('<%= txtReturn.ClientID %>');
var _Txtbal = document.getElementById('<%= txtbal.ClientID %>');
var t1 = 0, t2 = 0, t3 = 0;

if (_txtUsed.value != "") t1 = _TextBox1.value;
if (_TxtReturn.value != "") t2 = _TextBox2.value;
if (_lblGross.toString != "") t3 = _lblGross.toString;


_Txtbal.value = parseInt(t3) - parseInt(t1) - parseInt(t2);

}
</script>



i am trying to as i enter any number in text box cal should be make in balance with in second as per onkeyup function

推荐答案


这篇关于在Repeater中使用onkeyup功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 01:34