i have a form that has multiple rows for products and multiple columns within each row for sizes. the value to be entered in each size column is to be calculated as a total qty of sizes that then need to be multiplied by a unit price. the number columns for sizes varies anywhere from one column per row to as many as ten columns per row. how can script the total qty of all sizes in a given row?
Ex. SizeCol1_Row.1, SizeCol2_Row.1, SizeCol3_Row.1, etc. all in Row1.
I understand how to capture the row by using the "var cRow = event.target.name.split(".").pop()"
but how do I capture the Column sequence for looping through all the Size Cols until I have reached the end for the given row and then totalling them?
thanks!
SizeCol1_Row.1
SizeCol2_Row.1
SizeCol3_Row.1
...
SizeColx_Row.1
But x changes from row to row, correct?
You can place a this.getField("SizeCol"+i+"_Row.1") command in a loop (with i being the iterator, of course). When getField gives back null (because the field you were looking for doesn't exist), you exit the loop (break) and use the information you gathered so far to set the total field's value.
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com