Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
3
Answers
tax calculation
aiswarjya sarengi
7y
194
1
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
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