TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Munish Rana
NA
3
651
Sum is coming in (-) and value is adding up
Feb 3 2018 2:50 PM
$(function() {
//mask
$('#total_payment,#deductions').mask('#,##,##,###',{reverse : true});
//function that will get the total amount by each class
var net_payable = function() {
var sum=0;
$('#total_payment,#deductions').each(function(){
var num = $(this).val().replace(',','');
if(num != 0) {
sum -= parseFloat(num);
}
});
$('#net_payable').val(sum);
}
//key handler
$('#total_payment,#deductions').keyup(function(){
net_payable();
});
});
Reply
Answers (
1
)
Clearing a Typeahead if no value is selected from the dropdo
What is the use of event parameter in function(event)