Skip to main content
cmvarga5
Known Participant
August 5, 2026
Question

How to auto-populate content based on checkbox selection?

I have two checkboxes. For example, there are two different companies. Each selection will reveal an address in the exact same location, which is in the footer of the form. If Company A is selected, then that company’s address will populate in the footer. And same goes for Company B. If none of the checkboxes are selected, the footer will be empty. Is this possible? I am using both inDesign and Adobe Acrobat. Please advise if this can be done and how. Thank you!

5 commentaires

Anand Sri Bhattacharya
Community Manager
Community Manager
August 5, 2026

Hello @cmvarga5,


I hope you are doing well, and thanks for reaching out. We're sorry for the trouble.


Could you please share more details about the issue/workflow?


Is this specifically for Adobe Acrobat (PDF form fields with JavaScript), Adobe InDesign form fields before PDF export, or both?

Which version of Acrobat are you using? Check from Menu (Windows) | Acrobat (Mac) > Help > About Adobe Acrobat.

Should selecting Company A or Company B automatically fill a single text field in the footer, with only one company selectable at a time? A) Yes, B) Multiple selections allowed, C) Different behaviour.


Suggestions:

This is possible in a PDF form, but the conditional logic should be added in Adobe Acrobat after exporting from InDesign. InDesign can create basic fillable form fields, but Adobe’s InDesign Help specifically notes that advanced features such as validation or calculations should be finished in Acrobat and tested after export. Check this article for more information: https://adobe.ly/4q7IWJ5


The way is a single read-only text field in the footer whose value is set by a small calculation script based on which company is selected.


  1. Make the two choices mutually exclusive
    Since it is really an either/or (Company A or Company B, or neither), use two radio buttons that share the same field name (for example, "Company") with different button values, "A" and "B". Radio buttons with the same name are automatically mutually exclusive, so both can never be on at once. If you specifically want checkboxes, give two checkboxes the same name ("Company") with different export values "A" and "B"; same-name checkboxes behave as an exclusive group too, and they also let the user click the selected one off to clear it (which empties the footer).

  2. Add the footer address field
    Create one text field in the footer where the address should appear. In its Properties: General tab, add a Tooltip (e.g. "Selected company address") and set it Read Only; Options tab, tick Multi-line so the address wraps.

  3. Add the calculation script (in Acrobat, not InDesign)
    On that footer field: Properties > Calculate tab > Custom calculation script > Edit, and paste:


var c = this.getField("Company").value;
if (c == "A") event.value = "Company A\n123 A Street\nCity, ST 00000";
else if (c == "B") event.value = "Company B\n456 B Avenue\nCity, ST 11111";
else event.value = "";


Use \n for line breaks. When neither is selected, the group value is "Off", so the footer is blank, exactly as you wanted.


Please note that this script is a sample, and you may have to make changes according to your needs, the custom requirement, and the current environment you have, like app version, OS version, etc.


InDesign vs Acrobat: You can lay out the form and create the fields (radio buttons, text field, tooltips via the Description field) in InDesign and export a tagged interactive PDF, but InDesign cannot add calculation scripts. So add the script in Acrobat Pro under Prepare a Form. Filling the finished form works in the free Reader; only authoring needs Acrobat Pro.


On accessibility (since you tagged it): give every field a tooltip (Adobe treats the tooltip as the field's accessible name, tied to WCAG 1.3.1 and 4.1.2), make sure the form fields are tagged (All tools > Prepare for accessibility > Automatically tag form fields, then check with the Accessibility Checker), and set a logical tab/reading order (in InDesign via the Articles panel with "Use Structure for Tab Order"; verify in Acrobat).


Please note: a read-only calculated field will read its current value when a user tabs to it, but whether a screen reader automatically re-announces the address the instant the selection changes is not guaranteed and varies by screen reader and viewer. If guaranteed announcement matters, also surface the address as tagged text or a status line, and test with NVDA or JAWS. Calculation scripts only run in a JavaScript-capable viewer, Adobe Acrobat or Reader on desktop and the Acrobat mobile app. They do not run in most browser PDF viewers or macOS Preview, so it is worth adding a "best viewed in Adobe Acrobat/Reader" note for recipients.


A few reference links:

https://adobe.ly/4q7IWZB

https://adobe.ly/4hP7O67

https://adobe.ly/3TzKkbm


I hope this helps, and please reach out to us if you need any assistance.

Regards,

Anand Sri.

cmvarga5
cmvarga5Auteur
Known Participant
August 5, 2026

I prefer using checkboxes because the user an select/deselect -- which the radio button doesn’t allow. I do have different button values for each checkbox though (Company A and Company B).

Can this work?

Anand Sri Bhattacharya
Community Manager
Community Manager
August 5, 2026

Hello @cmvarga5,


Absolutely. If you already have unique export values assigned to each checkbox (for example, Company A and Company B), then this can work with checkboxes as well.

The main difference is that you'll need to account for all possible states:

  • Company A checked > show Company A address

  • Company B checked > show Company B address

  • Neither checked > leave the footer blank

  • Both checked > decide what should happen (blank, show a message, or prioritise one company)

Since checkboxes can be selected and deselected independently, Acrobat JavaScript can evaluate the checkbox values and populate a single footer text field accordingly.

If you're building the form in InDesign, I'd recommend handling the conditional logic after export in Acrobat Pro using a calculated field or JavaScript, as that's where Adobe supports advanced form behaviours such as calculations and scripting.


Please try the suggestions, and let us know how it goes.

Regards,

Anand Sri.