Highlighted

Today's data

New Here ,
Sep 08, 2020

Copy link to clipboard

Copied

I have a form that when opened, there is a "Today's Date" field that is supposed to grab the date. But it is not updating. It got a date of 03/18/2020 in there. I don't know where that date is coming from.

 

I followed this article, but no luck.

https://answers.acrobatusers.com/add-automated-today-date-form-javascript-q118604.aspx

 

I am using Adobe Acrobat Pro DC Version 2020.012.20043. Any help would be appreciated.

Topics

Acrobat SDK and JavaScript, PDF forms

Views

31

Likes

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

Today's data

New Here ,
Sep 08, 2020

Copy link to clipboard

Copied

I have a form that when opened, there is a "Today's Date" field that is supposed to grab the date. But it is not updating. It got a date of 03/18/2020 in there. I don't know where that date is coming from.

 

I followed this article, but no luck.

https://answers.acrobatusers.com/add-automated-today-date-form-javascript-q118604.aspx

 

I am using Adobe Acrobat Pro DC Version 2020.012.20043. Any help would be appreciated.

Topics

Acrobat SDK and JavaScript, PDF forms

Views

32

Likes

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
Adobe Community Professional ,
Sep 08, 2020

Copy link to clipboard

Copied

Is that field clickable or editable with a date picker? or is it read-only?

 

Is this field also used in a date calculation with other date fields? 

 

Have you checked if during form editing another datefield was rename with this same fieldname and now is grabbing that other's field's value?

 

And if you use CTRL+J to open the  debugger console what error(s) can you spot?

Likes

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
Reply
Loading...
New Here ,
Sep 08, 2020

Copy link to clipboard

Copied

 

Is that field clickable or editable with a date picker? or is it read-only? Read-only

 

Is this field also used in a date calculation with other date fields? 

JobAppDateFieldProperty-Calculuation.PNG

Have you checked if during form editing another datefield was rename with this same fieldname and now is grabbing that other's field's value? I did duplicate the field to a second page.

 

And if you use CTRL+J to open the  debugger console what error(s) can you spot?

TypeError: f is null
4:Document-Level:dateToday

 

Likes

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
Reply
Loading...
Most Valuable Participant ,
Sep 08, 2020

Copy link to clipboard

Copied

That means a field name specified in the code of that function is incorrect.

You should be able to find it under Tools - JavaScript - Document JavaScripts.

Likes

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
Reply
Loading...
ls_rbls LATEST
Adobe Community Professional ,
Sep 08, 2020

Copy link to clipboard

Copied

As try67 mentioned, verify if the field name used in the script need to be changed to the actual date field in your PDF.

 

You said you have a "Today's Date" field , but in the script referenced in the link that you shared that date field name is spelled "todayDate". Make suer  that the date field name is spelled in the same way in the script like this:

 

function dateToday() {
    var d = new Date();
    f = this.getField("Today's Date");
    f.value = d;
}

dateToday();

Likes

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
Reply
Loading...
Resources
One Stop Solution for Acrobat
Edit a PDF