How do I clear the last input if total exceeds the value of another field ?
I have five input fields (amount.1 through amount.5) that sum up in a Total field. In the Total field, I have a script (see below) in Validate that compares to another field (Adjustment amount) and alerts the user if Total exceeds Adjustment amount. The alert works fine, but I would like for it to clear or zero out the last field that was input that triggered the alert.
var TAA = this.getField("txtAdjustmentAmt").value;
if (TAA > 0) { //If TAA returns with a negative number, then the following will not occur
if (event.value > TAA){
app.alert("Total to apply cannot exceed the Adjustment amount")
event.rc = false;
}
}