Skip to main content
kerrye27211578
Participant
December 7, 2023
Answered

Text field response from checkbox selection.

  • December 7, 2023
  • 3 replies
  • 809 views

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.

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer try67

"Choice1" is the value, so use this:

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

3 replies

kerrye27211578
Participant
December 7, 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;

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
December 7, 2023

"Choice1" is the value, so use this:

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

kerrye27211578
Participant
December 8, 2023

Thanks try67. That worked perfectly. Much appreciated. Kerry