I am making an estimate sheet with an add/ remove instance subform labeled "Instance". I can add and remove the forms with no problem. Within the instance is a numerical field called "Price". I need to SUM total the Price field on every instance that I add. Also, if I remove one of the instances, I need it to deduct from the total (I read there were errors with this).
These are the scripts I have in each field:
---------------------------------
-Instance-
_Instance.addInstance(1);
xfa.form.recalculate(1);
// Verify at least one instance of the numAmount field exists.
if (exists(detail[0].numAmount) == 1) then
Sum(detail[*].numAmount)
endif
-Total-
Sum(Instance.#Price[0][*].rawValue)
----------------------------------
I might be off by a few characters. I am a beginner with javascript/ livecycle, so I pretty much Frankensteined this code. Addinstance isn't something I can accomplish with Acrobat Pro alone. So I'm thrown into the fire w/ Livecycle.
I have searched in and out of google, this forum and livecycle help. I can't figure this problem out. Help will be extremely appreciated!