the value entered does not match the format of the field
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?