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

Radio button Javascript

New Here ,
Dec 11, 2023 Dec 11, 2023

Copy link to clipboard

Copied

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

Views

406

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
1 ACCEPTED SOLUTION
Community Expert ,
Dec 12, 2023 Dec 12, 2023

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

@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

 

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

Copy link to clipboard

Copied

Thanks but i sorted out, This is the code 

Screenshot 2023-12-12 at 5.53.27 PM.png

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

Copy link to clipboard

Copied

What are the names of the radio buttons?

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

Copy link to clipboard

Copied

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 = "";

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