0
New Here
,
/t5/acrobat-discussions/checkbox-total-change-colour-if-greater-than-amp-check-another-checkbox/td-p/15079457
Jan 09, 2025
Jan 09, 2025
Copy link to clipboard
Copied
Hi All,
I have a textbox successfully calculating the total of checkboxes checked:
var total = 0;
for (var i=1; i<=22; i++) {
if (this.getField("OC"+i).value!="Off") total++;
}
event.value = total;
I would like the text to turn red if the total value is greater than 11 and also check another checkbox if the value is greater than 10.
Can anybody help?
TOPICS
PDF
,
PDF forms
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 ACCEPTED SOLUTION
Community Expert
,
/t5/acrobat-discussions/checkbox-total-change-colour-if-greater-than-amp-check-another-checkbox/m-p/15079469#M492121
Jan 09, 2025
Jan 09, 2025
Copy link to clipboard
Copied
Add this to the end of the code:
event.target.textColor = (total>11) ? color.red : color.black;
this.getField("OtherCheckBoxNameGoesHere").checkThisBox(0, total>10);
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/acrobat-discussions/checkbox-total-change-colour-if-greater-than-amp-check-another-checkbox/m-p/15079469#M492121
Jan 09, 2025
Jan 09, 2025
Copy link to clipboard
Copied
Add this to the end of the code:
event.target.textColor = (total>11) ? color.red : color.black;
this.getField("OtherCheckBoxNameGoesHere").checkThisBox(0, total>10);
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
petes22959894
AUTHOR
New Here
,
LATEST
/t5/acrobat-discussions/checkbox-total-change-colour-if-greater-than-amp-check-another-checkbox/m-p/15079601#M492136
Jan 09, 2025
Jan 09, 2025
Copy link to clipboard
Copied
Thank you very much.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

