My Query is working fine for sum of Two numbers Addition(+).
But I need Subtract and Divide Action of that text Box,
i cant able to Done it and also by Google it.
i am adding - instead of + but i didn't get exact output.
So help me to How am Perform Subtract and Divide Options on Running time.
$(document).ready(function () {
//Iterate through each Textbox and add keyup event handler
$(".clsTxtToCalculate").each(function () {
$(this).keyup(function () {
//Initialize total to 0
var total = 0;
$(".clsTxtToCalculate").each(function () {
// Sum only if the text entered is number and greater than 0
if (!isNaN(this.value) && this.value.length != 0) {
total = total - parseFloat(this.value);
}
});
//Assign the total to label
//.toFixed() method will roundoff the final sum to 2 decimal places
$('#<%=lblTotalPrice.ClientID %>').html(total.toFixed(2));
});
});
});
No. | Item | Price |
|---|---|---|
1 | Milk: | |
2 | Bread: | |
Total Price |
Sorry For Repeated Posts Friends
Thanking You
Paul.S

JohnPosted Jul 1, 2016, 4:48 AM
JohnPosted Jul 1, 2016, 5:24 AM
Paul RajsPosted Jul 1, 2016, 5:20 AM
Paul RajsPosted Jul 1, 2016, 3:15 AM
JohnPosted Jul 1, 2016, 2:00 AM
JohnPosted Jul 1, 2016, 1:41 AM