$(document).ready(function () {
try {
$("input[id^=txtNumAmountToPay]").each(function () {
if ($(this).val() != "") {
var arrayRemarks = $(this).attr('id').split("txtNumAmountToPay");
var txtAmountToPayID = 'input[id="txtNumAmountToPay' + arrayRemarks[1] + '"]';
var txtOpenAmountID = 'input[id="hidNumAmountToPay' + arrayRemarks[1] + '"]';
var txtAmountToPay = parseFloat($(txtAmountToPayID).val().replace(",", ""));
var txtOpenAmount = parseFloat($(txtOpenAmountID).val().replace(",", ""));
if (txtAmountToPay < txtOpenAmount) {
$(this)[0].style.backgroundColor = "yellow";
}
else {
$(this)[0].style.backgroundColor = "white";
}
}
});
$("input[id^=txtNumAmountToPay]").change(function () {
if ($(this).val() != "") {
var arrayRemarks = $(this).attr('id').split("txtNumAmountToPay");
var txtAmountToPayID = 'input[id="txtNumAmountToPay' + arrayRemarks[1] + '"]';
var txtOpenAmountID = 'input[id="hidNumAmountToPay' + arrayRemarks[1] + '"]';
var txtAmountToPay = parseFloat($(txtAmountToPayID).val().replace(",", ""));
var txtOpenAmount = parseFloat($(txtOpenAmountID).val().replace(",", ""));
if (txtAmountToPay < txtOpenAmount) {
$(this)[0].style.backgroundColor = "yellow";
}
else {
$(this)[0].style.backgroundColor = "white";
}
}
});
try {
$("input[id^=txtNumAmountToPay]").each(function () {
if ($(this).val() != "") {
var arrayRemarks = $(this).attr('id').split("txtNumAmountToPay");
var txtAmountToPayID = 'input[id="txtNumAmountToPay' + arrayRemarks[1] + '"]';
var txtOpenAmountID = 'input[id="hidNumAmountToPay' + arrayRemarks[1] + '"]';
var txtAmountToPay = parseFloat($(txtAmountToPayID).val().replace(",", ""));
var txtOpenAmount = parseFloat($(txtOpenAmountID).val().replace(",", ""));
if (txtAmountToPay < txtOpenAmount) {
$(this)[0].style.backgroundColor = "yellow";
}
else {
$(this)[0].style.backgroundColor = "white";
}
}
});
$("input[id^=txtNumAmountToPay]").change(function () {
if ($(this).val() != "") {
var arrayRemarks = $(this).attr('id').split("txtNumAmountToPay");
var txtAmountToPayID = 'input[id="txtNumAmountToPay' + arrayRemarks[1] + '"]';
var txtOpenAmountID = 'input[id="hidNumAmountToPay' + arrayRemarks[1] + '"]';
var txtAmountToPay = parseFloat($(txtAmountToPayID).val().replace(",", ""));
var txtOpenAmount = parseFloat($(txtOpenAmountID).val().replace(",", ""));
if (txtAmountToPay < txtOpenAmount) {
$(this)[0].style.backgroundColor = "yellow";
}
else {
$(this)[0].style.backgroundColor = "white";
}
}
});
No comments:
Post a Comment