Tuesday, 19 February 2013

JavaScript calculation in asp.net grid

function CalculateTotalPrice(Price, Quantity, GrossTotal) {

    var LblPrice = document.getElementById(Price);
    var TxtQuantity = document.getElementById(Quantity);
    var TxtGrossTotal = document.getElementById(GrossTotal);

    if ((TxtQuantity.value == '') || (TxtQuantity.value == '0')) {
        var Quantity_ = 0;
    }
    else {
        var Quantity_ = TxtQuantity.value;
    }

    TxtGrossTotal.value = (parseFloat(LblPrice.innerHTML) * parseInt(Quantity_)).toFixed(2);
}

No comments:

Post a Comment