Posts

Showing posts with the label foxit

Use Javascript to compare time ranges in PDF form

Image
I have a PDF form with 6 different time periods for each day of the month and I need to make sure those time periods do not overlap when the user completes them. Not all time periods may be completed, but the ones that do must be unique. I have taken inspiration from this previous post Use JavaScript to compare time ranges specifically the contribution by @RobG. However, my lack of scripting knowledge is hampering my ability to mold that code for my specific application. In addition to have the time periods verified, I also have to repeat this for every day on the form but I would like to do it one day at a time particularly when the entries are made for that day. Since this is a PDF form, I am not certain how to execute that validation. For example, should it execute every time a time period is completed? That is, have a Start Time and and End Time? So it would act as a "validation" script for that time entry? Here is a sample of what the form looks like: Here is my ...