Count Total number of Checkboxes
Hello everyone,
I'm fairly new at Javascripting and PDF forms, and I would love some help,
I have a list of books with checkboxes which spams for almost 9 hundred items, and I want to count the total number of checkboxes (checked and unchecked); as I have deleted some fields I know that the last numeral isn't the total. So I'd like for a way to calculate it automatically
I've managed to put this code together:
var cntr = 0;
for (var i = 0; i <= this.numFields; i++)
{
var mf = this.getField(this.getNthFieldName(i));
if (mf.type == "checkbox")
{
cntr++;
}
}
event.value = cntr;
However the number thrown is "685", but the last checkbox numeral is 896; and I didn't delete more than 10-15 fields.
Thank you so much in advance!
Have a great day!
