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

Text field response from checkbox selection.

Community Beginner ,
Dec 07, 2023 Dec 07, 2023

I'm trying to get an Acrobat form text field to display one of three answers depending on which checkbox above it was selected. Any help much appreciated.

TOPICS
Create PDFs , Modern Acrobat , PDF , PDF forms
815
Translate
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
1 ACCEPTED SOLUTION
Community Expert ,
Dec 07, 2023 Dec 07, 2023

"Choice1" is the value, so use this:

if (this.getField("Criteria 1").valueAsString == "Choice1")

View solution in original post

Translate
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 Beginner ,
Dec 07, 2023 Dec 07, 2023

Sorry, I'm new to this. They are radio buttons. They are all under Criteria 1 and set as Radio Button Choice 1, 2 and 3.

I'm using the code below but don't know how to write correctly name Criteria 1 choice 1 to call the getField.

"var text = "Static text goes here";
if(this.getField("Criteria 1.Choice1").valueAsString != "Off")
text += "button 1 text";
if(this.getField("Criteria 1.Choice2").valueAsString!= "Off")
text += "button 2 text";
if(this.getField("Criteria 1 .hoice3").valueAsString!= "Off")
text += "button 3 text";
event.value = text;

Translate
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 ,
Dec 07, 2023 Dec 07, 2023

"Choice1" is the value, so use this:

if (this.getField("Criteria 1").valueAsString == "Choice1")

Translate
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 Beginner ,
Dec 07, 2023 Dec 07, 2023
LATEST

Thanks try67. That worked perfectly. Much appreciated. Kerry

Translate
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