Javascript to Make an Autofill Editable
I am creating a form with mutli pay options available.
I would like the first payment amount ("Amount To Be Paid on First Card") to autofill with the total amount but be editable if the total amount ("Amount To Be Paid") is to be split. In that event, I would also like other fields ("Amount To Be Paid on Second Card") to become required if the first amount is lesser than the total amount.
I am entering the following code into the Amount To Be Paid on First Card custom calculation script field.
It pulls the auto fill, it makes the secondary payment field required, but it does not allow the amount to be changed from the autofill of the total amount.
I am still learning (mostly from this community) and would appreciate any help that can be offered. My attempt is below. Thank you for any assistance.
event.value = this.getField("Amount To Be Paid").value;
var n = this.getField("Amount To Be Paid On First Card").value;
if (n < "Amount To Be Paid On First Card") {
testMyField(event.value, "Amount To Be Paid On Second Card");
}
