Copy link to clipboard
Copied
Hello!
i have below script for calculating total months of seafarers voyages. It calculates correctly BUT i get the "the value entered does not match the format of the field" error wherever in the form i try to input data.
event.value = "";
var cBegin = new Date(this.getField("SIGN ONRow1").valueAsString);
var cEnd = new Date(this.getField("SIGN OFFRow1").valueAsString);
var nDiffMonths = (cEnd.getDate() - cBegin.getDate()) / 30 +
cEnd.getMonth() - cBegin.getMonth() +
(12 * (cEnd.getFullYear() - cBegin.getFullYear()));
// set field value;
event.value = nDiffMonths;
Any suggestions please?
Copy link to clipboard
Copied
What format does you use? What happens when you change the format to "None".
Copy link to clipboard
Copied
same thing with forma to "None"
I am not very familiar with Java but i understand that i need to add another option to my script?
Copy link to clipboard
Copied
Info: Acrobat uses Javascript, not Java.
Copy link to clipboard
Copied
yes you are right...still no luck though
Copy link to clipboard
Copied
May be that you get the message at a other field.
Copy link to clipboard
Copied
can i attach the form so you can take a quick look please?
Copy link to clipboard
Copied
Do you get alert when try to enter date in field?
If yes, check if field is formated to date and make sure you enter date correctly.
Copy link to clipboard
Copied
The format of the field is date. The problem is not in the format, the error i get is when i try to input data on every single field on the form even if it is unrelated with the calculation field.
Copy link to clipboard
Copied
Can you share your file?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
The popup displays the name of the field with the format error.
Copy link to clipboard
Copied
Here's an article that explains the problem and how to fix it.
https://www.pdfscripting.com/public/Value-Entered-Does-Not-Match-Format.cfm?sd=40