Skip to main content
Participating Frequently
August 17, 2022
Answered

How to display selected checkbox in a separate text field ?

  • August 17, 2022
  • 2 replies
  • 2034 views

Hi,

I'm trying to make a form with acrobat where I have a list of items associated with a checkbox, and I would like to display the items checked in a separate textfield.

Thank you for your time and help !

This topic has been closed for replies.
Correct answer Nesa Nurani

HI Nesa,

Not sur if this link works to see the form fields but here it is : https://acrobat.adobe.com/link/review?uri=urn:aaid:scds:US:8fdda961-362b-321b-b2cd-512c2e873146


You are missing "Box37" field.

2 replies

try67
Community Expert
Community Expert
August 17, 2022

It seems your two posts were merged, and unlocked. I was told they were flagged (incorrectly) automatically by the forum's spam system, so don't take it personally.

 

To answer your question: Yes, this is possible with a script. What are the names of the check-boxes? What values do you want to use when they are ticked (using the field-names, or the export values, or something else)? And how do you want them to be combined (each item on a separate line, or separated by a comma, or something else)?

Participating Frequently
August 18, 2022

Ok, thank you for letting me know what happend.

My check-box names are Box1 to Box48, and I would like to display the tooltip if possible, as it correspond to the item name in the list. Each item on a separate line would be perfect, on 2 or 3 columns (can be up to a selection of 20 items). Would it be possible to display the amount of total item selected ? I don't know if it matters but I have added the check-box in word before exporting it to Acrobat.

Thank you very much for your time and help, it is very appreciated.

try67
Community Expert
Community Expert
August 18, 2022

Doing it in columns is tricky. It will only display properly if the texts are all more or less the same length.
You can use this code (as the custom calculation script of the text field) to show each item on a separate line:

 

var summary = "";
var counter = 0;
for (var i=1; i<=48; i++) {
	if (this.getField("Box"+i).valueAsString!="Off") {
		counter++;
		summary+=this.getField("Box"+i).userName+"\r";
	}
}
summary+="Total number of boxes ticked: " + counter;
event.value = summary;
Participating Frequently
August 17, 2022

Why my post keeps getting flagged as innappropriate ????

Participating Frequently
August 17, 2022
try67
Community Expert
Community Expert
August 17, 2022

That is odd. I will follow up regarding your post with those in charge and hopefully it will get unblocked soon enough.