Skip to main content
anthiam15561249
Participant
May 20, 2026
Question

Need a javascript form field to populate a checkbox answer to another page

  • May 20, 2026
  • 1 reply
  • 29 views

Form field

I need a javascript to populate the text of a checkbox onto another page. For example, there will be a ‘yes’ checkbox, ‘no’ checkbox and ‘dont know’ checkbox. When a user clicks on the checkbox, the answer (for eg. ‘Yes’) will be autopopulated onto another page in the same pdf.

For example:
___ ‘yes’     ___’No’   ___’don’t know

When ‘yes’ is checked, the word ‘yes’ will appear in another page text field. 

    1 reply

    Nesa Nurani
    Community Expert
    Community Expert
    May 20, 2026

    What are the names of checkboxes and text field?

    anthiam15561249
    Participant
    May 21, 2026

    The name of the 3 checkboxes are Y1, N1, DK1 (form field)

    The text for the 3 checkboxes are Yes, No and Don’t know.
     

    If user checks ‘Yes’, I would like the word ‘Yes’ appear on the next page question. (so auto populate the chosen answer)

    Nesa Nurani
    Community Expert
    Community Expert
    May 21, 2026

    In the text field where you wish answer to show, go to properties, select calculate tab and as ‘Custom calculation script’ use this:

    var f = this.getField.bind(this);

    event.value =
    f("Y1").valueAsString !== "Off" ? "Yes" :
    f("N1").valueAsString !== "Off" ? "No" :
    f("DK1").valueAsString !== "Off" ? "Don't know" : "";