Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
3
Reply
tax calculation
aiswarjya sarengi
Aug 1 2017 3:48 AM
174
Reply
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
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
how to unselect the table column using javascript
html form data to be saved in excel using javascript