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

Checkbox value in Text Field

Explorer ,
Mar 24, 2021 Mar 24, 2021

Copy link to clipboard

Copied

Hi

 

I have 5 check Boxes named as Check Box1, Check Box2, Check Box3, Check Box4, Check Box5

& a TextField named as Score. I want when I check (Check Box1) a Value 5 appear in Score textfield.

& when i check Check Box2 value 10 appears in Score text field & so on.

 

Any help?

 

Thanks & Regards

Junaid Khalid

TOPICS
Create PDFs , JavaScript , PDF forms

Views

5.0K

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 2 Correct answers

Community Expert , Mar 24, 2021 Mar 24, 2021

If you are gonna check only 1 you can use this code:

if(this.getField("Check Box1").valueAsString != "Off")
event.value = "5";
else if(this.getField("Check Box2").valueAsString != "Off")
event.value = "10";
else if(this.getField("Check Box3").valueAsString != "Off")
event.value = "15";
else if(this.getField("Check Box4").valueAsString != "Off")
event.value = "20";
else if(this.getField("Check Box5").valueAsString != "Off")
event.value = "25";
else event.value = "";

Votes

Translate

Translate
Community Expert , Mar 24, 2021 Mar 24, 2021

Votes

Translate

Translate
Community Expert ,
Feb 14, 2022 Feb 14, 2022

Copy link to clipboard

Copied

LATEST

Where does you use the script?

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