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

Help!! Java Script Formula - Advanced Timesheet

New Here ,
Apr 03, 2025 Apr 03, 2025

Hi All

 

I'm new to making froms using Acrobat, great lerning curve. I',m bit stuck so here is my issue 

I've have found codes for most of my form but strugging on the follwing. 

 

If Start Time 1.0 = Off          , Added 10 spaces so you dont see the "h" that I added to the times on the drop down. 

I basiclly want it so that if someone selects Off on the Start time box all breaks and End time change to off and the value on the Day hours shows as 0.0h 

 

Secondly I have the start and end time calulating but haven't worked out how to take away the breaks for 2nd and 3rd break 1st break will be paid so won't be removed from overall time. 

 

Any assistance would be greatly appreciated 

 

Brian31680416h815_4-1743698494575.png

Thanks 

 

Brian 

 

TOPICS
JavaScript , PDF , PDF forms
89
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 ,
Apr 03, 2025 Apr 03, 2025
LATEST

There are plenty of issues with your file and code... For starters, you can't apply values to drop-downs if they don't contain them, or have the "Allow user to enter custom text" option selected.

Also, the comparison operator in JS is "==", not "=".

These are some of the major issues I'm seeing right off the bat.

As for the rest, you can use a custom validation script under the Start Time field to set the other fields as "Off" if "Off" is selected in it.

For the hours calculation you will need to calculation the difference in minutes between the end time and the start time (this is assuming they are both on the same calendar day!), and then deduct from that the amount selected under the 2nd and 3rd break fields in that row. Then convert the results to hours and minutes and apply it to the field's value.

 

If you're interested in hiring a professional to create it all for you, feel free to contact me privately by clicking my user-name and then on the blue "Message" button.

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