Click here to Skip to main content
15,911,890 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: Calculation in javascript Pin
Krasimir Dermendzhiev16-Mar-21 21:36
Krasimir Dermendzhiev16-Mar-21 21:36 
GeneralRe: Calculation in javascript Pin
Krasimir Dermendzhiev30-Mar-21 4:22
Krasimir Dermendzhiev30-Mar-21 4:22 
QuestionJavascript CSP and CORS problem? How can I send Cookies with AJAX in CORS? Pin
Member 1510027614-Mar-21 21:50
Member 1510027614-Mar-21 21:50 
AnswerRe: Javascript CSP and CORS problem? How can I send Cookies with AJAX in CORS? Pin
Richard Deeming14-Mar-21 22:39
mveRichard Deeming14-Mar-21 22:39 
GeneralRe: Javascript CSP and CORS problem? How can I send Cookies with AJAX in CORS? Pin
Member 1510027614-Mar-21 23:11
Member 1510027614-Mar-21 23:11 
GeneralRe: Javascript CSP and CORS problem? How can I send Cookies with AJAX in CORS? Pin
Richard Deeming14-Mar-21 23:29
mveRichard Deeming14-Mar-21 23:29 
GeneralRe: Javascript CSP and CORS problem? How can I send Cookies with AJAX in CORS? Pin
Member 1510027615-Mar-21 7:56
Member 1510027615-Mar-21 7:56 
GeneralRe: Javascript CSP and CORS problem? How can I send Cookies with AJAX in CORS? Pin
Richard Deeming15-Mar-21 22:31
mveRichard Deeming15-Mar-21 22:31 
GeneralRe: Javascript CSP and CORS problem? How can I send Cookies with AJAX in CORS? Pin
Member 1510027616-Mar-21 6:49
Member 1510027616-Mar-21 6:49 
Questionif statement not working Pin
chizzy4211-Mar-21 7:53
chizzy4211-Mar-21 7:53 
AnswerRe: if statement not working Pin
NotTodayYo11-Mar-21 8:24
NotTodayYo11-Mar-21 8:24 
AnswerRe: if statement not working Pin
W Balboos, GHB11-Mar-21 8:45
W Balboos, GHB11-Mar-21 8:45 
GeneralRe: if statement not working Pin
chizzy4213-Mar-21 4:03
chizzy4213-Mar-21 4:03 
GeneralRe: if statement not working Pin
Member 1510027615-Mar-21 8:15
Member 1510027615-Mar-21 8:15 
GeneralRe: if statement not working Pin
chizzy4217-Mar-21 2:28
chizzy4217-Mar-21 2:28 
QuestionBeginner 5 Project idea Pin
Member 1373246628-Feb-21 14:29
Member 1373246628-Feb-21 14:29 
AnswerRe: Beginner 5 Project idea Pin
Richard MacCutchan28-Feb-21 21:37
mveRichard MacCutchan28-Feb-21 21:37 
AnswerRe: Beginner 5 Project idea Pin
Scott Butchers19-Mar-21 3:26
Scott Butchers19-Mar-21 3:26 
QuestionHow to navigate to next search term in angular with up and down arrow buttons? Pin
shruti devurkar18-Feb-21 5:54
shruti devurkar18-Feb-21 5:54 
SuggestionRe: How to navigate to next search term in angular with up and down arrow buttons? Pin
CHill6018-Feb-21 5:55
mveCHill6018-Feb-21 5:55 
QuestionTrying to read a value that is coming from html() function from Table Cell Id Pin
simpledeveloper17-Feb-21 19:42
simpledeveloper17-Feb-21 19:42 
AnswerRe: Trying to read a value that is coming from html() function from Table Cell Id Pin
Richard MacCutchan17-Feb-21 21:38
mveRichard MacCutchan17-Feb-21 21:38 
GeneralRe: Trying to read a value that is coming from html() function from Table Cell Id Pin
simpledeveloper17-Feb-21 21:59
simpledeveloper17-Feb-21 21:59 
GeneralRe: Trying to read a value that is coming from html() function from Table Cell Id Pin
Richard MacCutchan17-Feb-21 22:45
mveRichard MacCutchan17-Feb-21 22:45 
GeneralRe: Trying to read a value that is coming from html() function from Table Cell Id Pin
simpledeveloper17-Feb-21 22:47
simpledeveloper17-Feb-21 22:47 
No totalRemaining is also printing as 5000.00, but when I am trying to add them its retuning NaN

My total function as below:
saveTotalPenalty: function (paramdata, id, indx) {
    var m = this.get('model');

    let totalRemaining = m.PaymentPlan.TotalAmount;

    this.penaltyPerUnit = $(this.boxId).val() / paramdata.Cnt;
    this.penaltyPerUnit = this.penaltyPerUnit.toFixed(2);

    if ((m.PaymentPlan.ViolationsUniquePenaltyApplied != null) && (m.PaymentPlan.ViolationsUniquePenaltyApplied != 'undefined'))
        for (let i = 0; i < m.PaymentPlan.ViolationsUniquePenaltyApplied.length; i++) {
            let t = '#' + 'td0' + i;
            let a = parseFloat($(t).html().valueOf());

            console.log('a');
            console.log(a);
            totalRemaining = parseFloat(totalRemaining) - a;
            console.log('totalRemaining');
            console.log(totalRemaining);
        }

    if ((m.PaymentPlan.ViolationsUniquePenaltyNotApplied != null) && (m.PaymentPlan.ViolationsUniquePenaltyNotApplied != 'undefined'))
        for (let i = 0; i < m.PaymentPlan.ViolationsUniquePenaltyNotApplied.length; i++) {
            let t = '#' + 'txt' + i;
            totalRemaining = totalRemaining - $(t).val();
        }

    totalRemaining = totalRemaining.toFixed(2);
    $('#thTotalRemaining').html(totalRemaining)

    if ((paramdata.PenaltyAssessed == null) || (paramdata.PenaltyAssessed == 0) || (paramdata.PenaltyAssessed == 'undefined') || isNaN(paramdata.PenaltyAssessed))
        return;

    $('#td' + indx).html(this.penaltyPerUnit);
    var scope = this;
    var data = {
        violationPenaltyAdjustment: paramdata,
        CaseId: id,
        PenaltyAssessed: paramdata.PenaltyAssessed
    };

    scope.api('Paymentxxxn/AddTotalxxxx').post(data).then(function (response) {
        //scope.set('model', response.Data.plan);
        toastr.success("Payment added");
    }, function (error) {
        Ember.set(payment, "isLoading", false);
        toastr.error("Error adding payment plan item");
    });
}


modified 18-Feb-21 5:06am.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.