PDF Javascript Issue With Date Selector
- August 16, 2020
- 1 reply
- 4651 views
I have a PDF with some javascript that's used to calculate the time remaining in a mortgage contract, in years in months, as of the current date. The formula is:
Current Date - (Date Loan Closed + # years in the contract).
I have the formula calulating correctly, but for some reason, when the dates are entered then changed, whether entered manually or via the drop down, the "Remaining" portion spits out a single, random number. I have the date format set to mm/dd/yyyy.
For example, if a user entered "7/13/2005," I have a pop-up saying that the format needs to be corrected (since in this example, there needs to be a zero in front of 7). Once this change occurs, the "Remaining" calculation becomes incorrect. I'm not 100% that this glitch is caused from the date fields, but I can't seem to replicate it any other way.
I've attached a video of the error occuring so it might make more sense, as well as the pdf.
