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

Radio button Javascript

New Here ,
Dec 11, 2023 Dec 11, 2023

Screenshot 2023-12-12 at 10.16.33 AM copy.jpg

 

The 3year radio button value is 36 and 5year radio button value is 60. So the amount saved per month X period = Total saving Value it’s fine.

 

But in the tax free bonus if we select 3years it must be Save per month X 1.1

 

if we select 5years it must be Save per month X 3.2

 

I used this code

Screenshot 2023-12-12 at 11.15.56 AM.png

 

But it’s not working only the 5year value is reflecting not the 3 year.

TOPICS
JavaScript , PDF forms
689
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 12, 2023 Dec 12, 2023
LATEST

Only the last condition is triggered in your script.

Use this:

if(this.getField("year").valueAsString === "36")
event.value = Number(this.getField("save_month").valueAsString) * 1.1;
else if(this.getField("year").valueAsString == "60")
event.value = Number(this.getField("save_month").valueAsString) * 3.2;
else
event.value = "";

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 Expert ,
Dec 12, 2023 Dec 12, 2023

@Sankaralingam24387454d8cr 

 

I've moved your post to the Adobe Acrobat forum for you. Can you show a screen shot that includes the other related fields?

 

Jane

 

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
New Here ,
Dec 12, 2023 Dec 12, 2023

Thanks but i sorted out, This is the code 

Screenshot 2023-12-12 at 5.53.27 PM.png

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 12, 2023 Dec 12, 2023

What are the names of the radio buttons?

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 12, 2023 Dec 12, 2023
LATEST

Only the last condition is triggered in your script.

Use this:

if(this.getField("year").valueAsString === "36")
event.value = Number(this.getField("save_month").valueAsString) * 1.1;
else if(this.getField("year").valueAsString == "60")
event.value = Number(this.getField("save_month").valueAsString) * 3.2;
else
event.value = "";
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