javascript:
- function taxCalc()
- {
- var _txt1 = document.getElementById('<%= txtPremamnt.ClientID %>');
- var _txt2 = document.getElementById('<%= txtSrvtax.ClientID %>');
- var _txt3 = document.getElementById('<%= txtTotamnt.ClientID %>');
- var t1=0, t2=0;
- if(_txt1.value != "") t1=_txt1.value;
- if(_txt2.value != "") t2=_txt2.value;
- _txt3.value = parseInt(t1) + (parseInt(t1) * (parseInt(t2) / 100));
- }
- <asp:TextBox ID="txtPremamnt" runat="server" onkeypress="taxCalc();" class="form-control " placeholder="Pre. Amt">asp:TextBox>
- <asp:TextBox ID="txtSrvtax" runat="server" placeholder="Srv. Tax" class="form-control ">asp:TextBox>
- <asp:TextBox ID="txtTotamnt" runat="server" placeholder="Tot. Amt" class="form-control ">asp:TextBox>
OUTPUT:
Pre. Amt:1000
Tax: 10
Total:110
when I changed
Pre. Amt:1000
Tax: 10
Total:1100
Please check this
Midhun TpPosted Aug 1, 2017, 4:51 AM
Rafnas T PPosted Aug 1, 2017, 4:53 AM
Rafnas T PPosted Aug 1, 2017, 4:42 AM