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

Creating a Form with Calculations and Checkboxes

New Here ,
Nov 25, 2024 Nov 25, 2024

Copy link to clipboard

Copied

I am trying to figure out a formula for a fillable form, if it can even be done.  

If you click one box (Super.3) it would populate "SectionScore1" * 30% or .3

and if you click box (Other.4) it would pupulate "SectionScore1" * 40% or .4

I am trying to get both of these formulas in the same answer box. 

 

Otherwise, I am just going to take out the check boxes and have to answer box options. 

TOPICS
JavaScript , PDF forms

Views

129

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 , Nov 25, 2024 Nov 25, 2024

Why not create 2 check boxes with the same name and 2 different export values?  In this example the export values would be .3 and .4.  This way, only one could be checked at a time.  If the check box name is Super.3, enter the following custom calculation script in the field:

if(this.getField("Super.3").value != "Off")

{event.value=this.getField("Subscore1").value * this.getField("Super.3").value}

else

{event.value=""}

Votes

Translate

Translate
Community Expert , Nov 25, 2024 Nov 25, 2024

Just a tip if you go with the export values you don't need script, you can just use built in calculation option 'product(x)'.

Votes

Translate

Translate
Community Expert ,
Nov 25, 2024 Nov 25, 2024

Copy link to clipboard

Copied

Why not create 2 check boxes with the same name and 2 different export values?  In this example the export values would be .3 and .4.  This way, only one could be checked at a time.  If the check box name is Super.3, enter the following custom calculation script in the field:

if(this.getField("Super.3").value != "Off")

{event.value=this.getField("Subscore1").value * this.getField("Super.3").value}

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
Community Expert ,
Nov 25, 2024 Nov 25, 2024

Copy link to clipboard

Copied

Just a tip if you go with the export values you don't need script, you can just use built in calculation option 'product(x)'.

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 ,
Nov 25, 2024 Nov 25, 2024

Copy link to clipboard

Copied

LATEST

Thank you for your assistance! I am brand new to the calculating and javascript world and the search engine helped a ton with my other issues, but i didn't even know you add export values!

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