Garima Bansal

Garima Bansal

  • 1.1k
  • 680
  • 39.7k

add two numbers using textbox

Mar 24 2023 8:57 PM

Given Two text Boxes,I want add two numbers (using the two text boxes) and show the result in the thrid textbox (TextBox3) instantly i.e without pressing a asp.net button. 

<div class="row p-2 m-2" style="border: 2px">
         <div class="col-md-12">
             <center>
                 <h4>Number of Members</h4>
                 <hr />
             </center>
             <div class="row">
                 <div class="col-md-6">
                     <b class="form-control border-0 bg-transparent">Male
 <asp:RequiredFieldValidator runat="server" ControlToValidate="Txt_MembersRegistered_Male" Text=" *" ErrorMessage="Male (Members at Time of Registration) is required !" CssClass="text-danger"></asp:RequiredFieldValidator>
                     </b>
                     <asp:TextBox ID="TextBox1" runat="server" TextMode="Number" CssClass="form-control"></asp:TextBox>
                 </div>
                 <div class="col-md-6">
                     <b class="form-control border-0 bg-transparent">Female
 <asp:RequiredFieldValidator runat="server" ControlToValidate="Txt_MembersRegistered_Female" Text=" *" ErrorMessage="Female (Members at Time of Registration) is required !" CssClass="text-danger"></asp:RequiredFieldValidator>
                     </b>
                     <asp:TextBox ID="TextBox2" runat="server" TextMode="Number" CssClass="form-control"></asp:TextBox>
                 </div>

                 <div class="col-md-6">
                     <b class="form-control border-0 bg-transparent">
                         <asp:TextBox ID="TextBox3" runat="server"  placeholder="Total" CssClass="form-control"></asp:TextBox>
                     </b>
                 </div>

             </div>
         </div>
     </div>

 


Answers (7)