Custom Javascript: Defining target cell name based on host cell name
Hi,
I want to create a form for recording test results of large batches, so I have 400+ fields that I want to apply this percentage calculation to, the calculation will always be performed based on the values in the cells 1 & 2 positions to the left. So to avoid having to edit each of these fields manually and specifying the target fields name, I hope to be able to at the very least just have to paste in a custom script to each cell.
Given the number of fields adobe has created the form from a grid saved in the PDF. Is it possible to script the variable based on the cell name and apply it to the target names, see the example below?
Current script (I know the maths is currently wrong):
Cell name that holds this is Row1
var a = this.getField("FinishRow1"); var b = this.getField("StartRow1"); event.value = (a.value + b.value) * 0.0010;
Ps) Of course if I'm fundamentally approaching this in the wrong way any guidance would be appreciated.
