I have been trying to apply this code to the added rows of a table, but I can't seem to get it to work. The code is suppose to disable the submit button and display a message saying "Each Line Item must be equal to or greater than $5000" to any column under the Commitment Amount when an amount less than 5000 is placed in the field value. If the value is 5000 or greater the error goes away. I can get to work with the first row, but not with the other added rows to the table. May I please get some assistance
Here is the code I am using and a screen shot of the form and what I'm trying to do.
Code:
$('[id^=Field573]').on('change', function () {
console.log("test: " + $(document.activeElement).val() + " " + this.id)
if ($(this).val() < 5000) {
$('.Submit').attr("disabled", "disabled");
if ($('.warningText').length > 0 || $('.sum input').val() >= 5000){
return;
} else {
$('<p class="warningText"><font color="red"><b>Each Line Item must be equal to or greater than $5000.</b></font></p>').insertAfter(this);
}
}
else
$('.warningText').remove();
$('.Submit').removeAttr('disabled');
});