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

Calculate multiple day and date fields based on "Week Of" date input

New Here ,
Mar 23, 2020 Mar 23, 2020

Copy link to clipboard

Copied

I'm creating a new form based on an old webpage that had this feature. I'm hoping to get the "Date" Fields next to each day of the week to populate correctly no matter what day of the week a user inputs into the "Week Of" field. I've tried to adapt code I found in a handul of other posts with people making time sheets and such...but I just can't wrap my mind around Javascript enough to get it to work the way I need it. Any help or guidance would be much appreciated!

Screen Shot 2020-03-23 at 6.36.33 PM.png

TOPICS
Acrobat SDK and JavaScript

Views

265

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 ,
Mar 23, 2020 Mar 23, 2020

Copy link to clipboard

Copied

LATEST

So the first thing you need to do is rename the date and other fields so they can be used by a script. I would suggest naming them for the day of the week number, as defined by the Date.getDay() function, "DateDay0", "DateDay1", etc. Then you can use the "day" value from the "Week Of" field, to find the correct starting place for incremeting the dates.   

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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