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

How can I populate the amount fields based on whether or not a checkbox is checked?

New Here ,
Jul 30, 2024 Jul 30, 2024

Copy link to clipboard

Copied

I am trying to auto calculate a total amount from a list of different options with different amounts. 

I want it to work where if a checkbox is checked for a Charge (Cleaning, Minor Damage, Major Damage, etc.) that the cost for that charge is included in the autopopulated amount (Total Charges Owed). How can I go about this?

TOPICS
Create PDFs , How to , JavaScript , PDF , PDF forms

Views

278

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 , Jul 30, 2024 Jul 30, 2024

If the prices aren't going to change, make those text fields static text (not fields).  Remove your check boxes.  Create one check box at the top ("Check Box"), then right-click > Create multiple copies and add 8 fields down and 1 across.  Enter the prices as the export values of the check boxes (numbers only, eg. 200).  When a number is repeated, add a zero in front of it (eg. 200, 0200, 00200) so there are no duplicate export values.  In your Total field ("Text20"), in the calculation tab, sel

...

Votes

Translate

Translate
Community Expert , Jul 30, 2024 Jul 30, 2024

You don't need to use JavaScript.

Enter the prices as the export values of the check boxes. When a number is repeated, add one or two zero as decimal to avoid duplicate export values, because check boxes with exactly the same export value will be checked at the same time.

Make the "Text20" calculate the sum of the concerned checkboxes.

See Attachment.

 

Capture_2407301901.png

Votes

Translate

Translate
New Here ,
Jul 30, 2024 Jul 30, 2024

Copy link to clipboard

Copied

I have no knowledge of JS, but I have added this script which is just taking care of the first two lines of check boxes and amounts:

 

{Check_Box8: 1, check: "Yes", Text18: 200.00}
{Check_Box8: 1, check: "No", Text18: 00.00}
{Check_Box9: 1, check: "Yes", Text21: 500.00}
{Check_Box9: 1, check: "No", Text21: 00.00}

 

However, I keep getting the erro "SyntaxError: missing ; before statement 1: at line 2"

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 ,
Jul 30, 2024 Jul 30, 2024

Copy link to clipboard

Copied

If the prices aren't going to change, make those text fields static text (not fields).  Remove your check boxes.  Create one check box at the top ("Check Box"), then right-click > Create multiple copies and add 8 fields down and 1 across.  Enter the prices as the export values of the check boxes (numbers only, eg. 200).  When a number is repeated, add a zero in front of it (eg. 200, 0200, 00200) so there are no duplicate export values.  In your Total field ("Text20"), in the calculation tab, select Value is the sum of, and select the "Check Box" field only.  This article might help you.

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 ,
Jul 30, 2024 Jul 30, 2024

Copy link to clipboard

Copied

LATEST

You don't need to use JavaScript.

Enter the prices as the export values of the check boxes. When a number is repeated, add one or two zero as decimal to avoid duplicate export values, because check boxes with exactly the same export value will be checked at the same time.

Make the "Text20" calculate the sum of the concerned checkboxes.

See Attachment.

 

Capture_2407301901.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