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

Checkbox value in Text Field

Explorer ,
Mar 24, 2021 Mar 24, 2021

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
7.1K
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
2 ACCEPTED SOLUTIONS
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 = "";

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 ,
Mar 24, 2021 Mar 24, 2021
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 ,
Feb 14, 2022 Feb 14, 2022
LATEST

Where does you use the script?

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