I hope I am putting this in the right Forum Topic... Anyway, I am needing to create a large array of information... 5 columns wide, by 40 rows... Creating them is not the issue, I need to access the information in multiple fields on every row, so I would like to write the javascript just once and let it copy with the original elements... Here's the layout...
ChkBox Total Value_A Value_B Value_C
It should be noted that the Check Box is returning a numeric value, Value_A is a calculated value from outside the array (but will differ with each row), Values B and C are user input... It is with the Total that I am having the problem... I need it to Take the value returned from ChkBox, process it a little, add it to all of the Value_X entries to come up with a total.
Is there anyway to tell Total to access the values.0 or .1 or whatever respectively using just the field names and let it copy as Acrobat makes the table?
Thank you for any input!
Scooter
// field name is "values.2.1"
var field_name_parts = event.target.name.split(".");
The value of the variable field_name_parts will be an array. The first element (field_name_parts[0]) will be the string "values", the second element (field_name_parts[1]) will be the string "2" (row identifier), and the last element (field_name_parts[2]) will be the string "1" (column identifier).
So you can now do:
// Get the value of "Value_A" field for this row
var v1 = getField("values." + field_name_parts[1] + ".2").value;
// Do the same for the other input fields