Highlighted

Text Field not calculating properly

Contributor ,
Nov 17, 2020

Copy link to clipboard

Copied

I'm hoping someone can help me figure out how to resolve my text field not calculating properly.

I have a text field name 'TotalOTHrsEmp1'.  I click on 'Calculate' and choose 'Value is the' and pick the fields I want to calculate the hours.  There is one particular text field I am having a problem with calculating.  It's a checkbox that populates '1' to another text field.  When I check the box the hour doesn't add up, but when I uncheck the box the hour does add up.  That's not what I want, I want the '1' hour to add up in the 'TotalOTHrsEmp1' text field when the box is ticked.  Here is what I have set up...

The checkbox is named 'TravelTimePdEmp1'.  The text field is named 'TTPdEmp1' and in this text field I have a custom calculation script as follows, 

var a ="";

if (this.getField("TravelTimePdEmp1").value == "Yes"){

a="1";

}

event.value = a;

Thank you in advance for any help with this!

 

 

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

You have to move "TTPdEmp1" above "TotalOTHrsEmp1" in that list, so that it calculates first.

TOPICS
Acrobat SDK and JavaScript

Views

110

Likes

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

Text Field not calculating properly

Contributor ,
Nov 17, 2020

Copy link to clipboard

Copied

I'm hoping someone can help me figure out how to resolve my text field not calculating properly.

I have a text field name 'TotalOTHrsEmp1'.  I click on 'Calculate' and choose 'Value is the' and pick the fields I want to calculate the hours.  There is one particular text field I am having a problem with calculating.  It's a checkbox that populates '1' to another text field.  When I check the box the hour doesn't add up, but when I uncheck the box the hour does add up.  That's not what I want, I want the '1' hour to add up in the 'TotalOTHrsEmp1' text field when the box is ticked.  Here is what I have set up...

The checkbox is named 'TravelTimePdEmp1'.  The text field is named 'TTPdEmp1' and in this text field I have a custom calculation script as follows, 

var a ="";

if (this.getField("TravelTimePdEmp1").value == "Yes"){

a="1";

}

event.value = a;

Thank you in advance for any help with this!

 

 

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

You have to move "TTPdEmp1" above "TotalOTHrsEmp1" in that list, so that it calculates first.

TOPICS
Acrobat SDK and JavaScript

Views

111

Likes

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
Nov 17, 2020 0
Engaged ,
Nov 17, 2020

Copy link to clipboard

Copied

Try check field calculation order. 

Likes

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
Reply
Loading...
Nov 17, 2020 0
Contributor ,
Nov 17, 2020

Copy link to clipboard

Copied

Thank you for the reply, I tried that but it still only calculates after I uncheck the box 😞

Likes

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
Reply
Loading...
Nov 17, 2020 0
Most Valuable Participant ,
Nov 17, 2020

Copy link to clipboard

Copied

Can you share the actual file with us?

You can attach it to the original message using the tiny paperclip icon at the bottom when you edit it, or upload it to a file-sharing website (like Dropbox, Google Drive, Adobe Cloud, etc.), generate a share link and then post it here.

Likes

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
Reply
Loading...
Nov 17, 2020 0
Contributor ,
Nov 17, 2020

Copy link to clipboard

Copied

I have employee names and numbers on there which I think would be private information.  I don't want to share something I'm not supposed to 😞

Likes

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
Reply
Loading...
Nov 17, 2020 0
Contributor ,
Nov 17, 2020

Copy link to clipboard

Copied

I could make a more simple version with fake names and numbers and share it, it will just take me a while to do.

Likes

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
Reply
Loading...
Nov 17, 2020 0
Most Valuable Participant ,
Nov 17, 2020

Copy link to clipboard

Copied

Sure, that's fine.

Likes

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
Reply
Loading...
Nov 17, 2020 0
Contributor ,
Nov 17, 2020

Copy link to clipboard

Copied

Okay, I simplified it and deleted all the names and codes.  I will figure out how to share with your instructions 🙂

Likes

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
Reply
Loading...
Nov 17, 2020 0
Contributor ,
Nov 17, 2020

Copy link to clipboard

Copied

I think I did it.  I attached the Sample Copy and there's a paperclip next to it.  Did it work?

Likes

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
Reply
Loading...
Nov 17, 2020 0
Contributor ,
Nov 17, 2020

Copy link to clipboard

Copied

Likes

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
Reply
Loading...
Nov 17, 2020 0
Contributor ,
Nov 17, 2020

Copy link to clipboard

Copied

I don't know if that link worked.  I don't see any text fields when I open it.  I've never used dropbox before.

Likes

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
Reply
Loading...
Nov 17, 2020 0
Contributor ,
Nov 17, 2020

Copy link to clipboard

Copied

I've tried Googe Drive as well and I can't get my file to upload to share it.  Anyways, this is a snapshot of the set field calculation order.  Is there maybe something in here I need to fix?  Or could it have something to do with the one hour that populates to the text field when checking the box for travel time?  I definitely selected all the fields for the calculation, but only the other fields add up. It's really frustrating that 1 hour isn't calculating when you check the travel time box.  

traceyc28668387_0-1605671230345.png

 

traceyc28668387_1-1605671594397.png

Likes

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
Reply
Loading...
Nov 17, 2020 0
Contributor ,
Nov 17, 2020

Copy link to clipboard

Copied

Likes

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
Reply
Loading...
Nov 17, 2020 0
Contributor ,
Nov 18, 2020

Copy link to clipboard

Copied

I don't seem to have that option, hopefully my last link worked.  I just tried it and it's still not adding up in OT Total Hours when I check the travel time box.

traceyc28668387_0-1605714086460.png

 

Likes

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
Reply
Loading...
Nov 18, 2020 0
Most Valuable Participant ,
Nov 18, 2020

Copy link to clipboard

Copied

You have to move "TTPdEmp1" above "TotalOTHrsEmp1" in that list, so that it calculates first.

Likes

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
Reply
Loading...
Nov 18, 2020 0
Contributor ,
Nov 18, 2020

Copy link to clipboard

Copied

Thank you Try67!!  It works now 🙂 

Likes

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
Reply
Loading...
Nov 18, 2020 0
Adobe Community Professional ,
Nov 18, 2020

Copy link to clipboard

Copied

"I've tried Googe Drive as well and I can't get my file to upload to share it"

You should try this: https://helpx.adobe.com/acrobat/using/sharing-pdfs.html

 

sharing-tools

Likes

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
Reply
Loading...
Nov 18, 2020 0
Adobe Community Professional ,
Nov 18, 2020

Copy link to clipboard

Copied

It works in Acrobat Reader DC and Adobe Acrobat DC.

Likes

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
Reply
Loading...
Nov 18, 2020 0