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

I have one group of three radio buttons and based on selection, a text field should be populated

Community Beginner ,
Mar 07, 2021 Mar 07, 2021

Copy link to clipboard

Copied

I have a radio button group called "optPackage". There are three choices "studio", "plus", "premium". I want the choice to populate into a text field named "txtTotal". All my fields were generated in Acrobat.

 

I have typed this in the "Total" text field's custom calculation script field with no success, it completely does nothing and no errors are produced:

 

var v = this.getField(“optPackage”).value;

if (v==“studio”) event.value = “35”;

else if (v=="plus") event.value = “55”;

else if (v=="premium") event.value = “75”;

else event.value = "";

 

I'm stuck.

TOPICS
JavaScript , PDF forms

Views

376

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

correct answers 1 Correct answer

Community Beginner , Mar 07, 2021 Mar 07, 2021

I have solved it. I looked in the debugger by hitting cmd+J. Everything was throwing errors. Yikes!

 

Turns out, because I had copied from text editor (in plain text mode), my quotes were pasted in as the wrong type of character. Once I retyped them in the custom calculate script field, the form worked like a charm.

 

Hope this helps someone.

Votes

Translate

Translate
Community Beginner ,
Mar 07, 2021 Mar 07, 2021

Copy link to clipboard

Copied

LATEST

I have solved it. I looked in the debugger by hitting cmd+J. Everything was throwing errors. Yikes!

 

Turns out, because I had copied from text editor (in plain text mode), my quotes were pasted in as the wrong type of character. Once I retyped them in the custom calculate script field, the form worked like a charm.

 

Hope this helps someone.

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