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

New Here ,
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, Edit and convert PDFs, How to, PDF forms

Views

27

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

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

New Here ,
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, Edit and convert PDFs, How to, PDF forms

Views

28

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
Mar 23, 2020 0
Adobe Community Professional ,
Mar 23, 2020

Copy link to clipboard

Copied

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.   

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