Click here to Skip to main content
15,069,665 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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);


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
Updated 13-Apr-14 9:54am

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900