Click here to Skip to main content
15,441,040 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
hi all,

i have two HTML text boxes inside repeater. on text change of those text box i want to do sum and display in 3rd HTML text box using JQuery.

how can i achieve it?

Updated 4-Jun-21 1:36am

1 solution

Below is sample code

ASPX code

<html xmlns="">
<head runat="server">
    <title>Untitled Page</title>

    <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>

    <form id="form1" runat="server">
    <asp:Repeater ID="Repeater1" runat="server">
                <asp:TextBox ID="TextBox1" runat="server" Text=0 />
                <asp:TextBox ID="TextBox2" runat="server" Text=0 />
                <asp:TextBox ID="TextBox3" runat="server" />


     function GetTotalAmount(obj){
          var txtbox1id ='TextBox2','TextBox1');
          var txtbox2id ='TextBox1','TextBox2');
          var txtbox3id ='TextBox1','TextBox3').replace('TextBox2','TextBox3');
            var total =parseFloat($('#'+ txtbox1id).val()) +parseFloat($('#'+txtbox2id).val());
            $('#' + txtbox3id).val(total);

      $(document).ready(function() {
            $("input[id*=TextBox1]").each(function() {
            $(this).change(function() {

            $("input[id*=TextBox2]").each(function() {
            $(this).change(function() {


Share this answer
kk2014 25-May-13 9:27am     CRLF
hi, i said html text boxes not asp. but thanks for the reply. thanks.

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