• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

the value entered does not match the format of the field

New Here ,
Apr 09, 2021 Apr 09, 2021

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?

TOPICS
PDF forms

Views

1.2K

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
community guidelines
Community Expert ,
Apr 09, 2021 Apr 09, 2021

Copy link to clipboard

Copied

What format does you use? What happens when you change the format to "None".

Votes

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
community guidelines
New Here ,
Apr 09, 2021 Apr 09, 2021

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?

Votes

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
community guidelines
Community Expert ,
Apr 09, 2021 Apr 09, 2021

Copy link to clipboard

Copied

Info: Acrobat uses Javascript, not Java.

Votes

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
community guidelines
New Here ,
Apr 09, 2021 Apr 09, 2021

Copy link to clipboard

Copied

yes you are right...still no luck though

 

Votes

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
community guidelines
Community Expert ,
Apr 10, 2021 Apr 10, 2021

Copy link to clipboard

Copied

May be that you get the message at a other field.

Votes

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
community guidelines
New Here ,
Apr 12, 2021 Apr 12, 2021

Copy link to clipboard

Copied

can i attach the form so you can take a quick look please?

 

Votes

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
community guidelines
Community Expert ,
Apr 10, 2021 Apr 10, 2021

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.

Votes

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
community guidelines
New Here ,
Apr 11, 2021 Apr 11, 2021

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.

Votes

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
community guidelines
Community Expert ,
Apr 12, 2021 Apr 12, 2021

Copy link to clipboard

Copied

Can you share your file?

Votes

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
community guidelines
New Here ,
Apr 12, 2021 Apr 12, 2021

Copy link to clipboard

Copied

 

Votes

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
community guidelines
Community Expert ,
Apr 12, 2021 Apr 12, 2021

Copy link to clipboard

Copied

The popup displays the name of the field with the format error.

Votes

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
community guidelines
Community Expert ,
Apr 12, 2021 Apr 12, 2021

Copy link to clipboard

Copied

LATEST

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

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

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
community guidelines