MrPizzaFace
MrPizzaFace

Reputation: 8086

Acrobat forms and javascript calculation

In a form I have 4 radio buttons, under the label Q3. Also i have a text field labeled lictype Each radio button has its own respective Button Radio Choice Value

When a radio button is checked. I want the value of that button to be displayed in the lictype text field.

Here is the JS I tried in a calculation.

var q3 = this.getField("value")

if (q3.value == "Pre”){
{
lictype.value = “Pre";
}
elseif (q3.value == "Pro”)
{
lictype.value = “Pro";
}
elseif (q3.value == "Ult”)
{
lictype.value = “Ult";
}
else (q3.value == "Uns”)
{
lictype.value = “Uns";
}

VISUAL DESCRIPTION

Upvotes: 0

Views: 1559

Answers (1)

MrPizzaFace
MrPizzaFace

Reputation: 8086

If anyone is interested: I was able to accomplish this by using JS to do a SHOW/HIDE on elements in the ACROBAT properties menu.

  1. Set a different text field for each of the radio buttons
  2. Set the property of each radio button to SHOW and then HIDE the appropriate text field.

In the the text field: Stack all of them in the desired location and set each default value in the properties panel to their respective value names.

Problem solved!

Upvotes: 1

Related Questions