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

New Here ,
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

31

Likes

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

New Here , 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.

Likes

Translate

Translate
New Here ,
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.

Likes

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