• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Type into a field that is set to auto-generate from a checkbox?

New Here ,
May 11, 2020 May 11, 2020

Copy link to clipboard

Copied

Hello,

 

Is it possible to type into a field that is set to autogenerate information from a selected checkbox?

 

Example:

I have four checkboxes on page one of myy PDF that generate predermined phrases into a field located on page two. I'd like to add an additional field called 'Other'. I want the user to be able to type unrestricted information into the Other field and have the information generated in to the field on page two.

 

Below is the code I've applied to the field on page two. Is there anything I can add to get the desired results?

 

var a=""

 

if (this.getField("CB1").value == "Yes")
{
a="\u2610 Option One \n"
}

if (this.getField("CB2").value == "Yes")
{
a=a + "\u2610 Option Two \n"
}

if (this.getField("CB3").value == "Yes")
{
a=a + "\u2610 Option Three \n"
}

if (this.getField("CB4").value == "Yes")
{
a=a + "\u2610 Option Four \n"
}

event.value=a

TOPICS
Acrobat SDK and JavaScript

Views

334

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 12, 2020 May 12, 2020

Copy link to clipboard

Copied

LATEST

Change your code to the following:

 

if (event.source && //^CB\d$/.test(event.source.name)) {
// rest of code goes here
}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines