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

Cannot get date to auto-populate to today's date like I did on other documents before

New Here ,
Jun 23, 2021 Jun 23, 2021

I did a search a while back for how to get the date to autopopulate to today's date. I found an article that gave me this javascript to use (I do know know anything about java script so this was completely new).

 

This is the script: var f = this.getField("Today's Date");f.value = util.printd("mmm d, yyyy", new Date());

 

I created a text field, labled it "Today's Date". Clicked on the Javascript tool, then on Document Javascripts, names the script "Today's Date" and then put in the script and it worked.

 

default608essk0aok6_0-1624467118644.png

I am copied and pasted that script and followed the same process for other documents and it has always worked.

 

Not now, I am trying to do the same and it's not working.

 

I tried clicking on Debugger just to see what that was (I have no idea what I'm doing) and this is what it showed:

default608essk0aok6_1-1624467315178.png

 

 

Can someone help please? I would sure appreciate it!

TOPICS
How to , JavaScript , PDF forms
2.3K
Translate
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 ,
Jun 23, 2021 Jun 23, 2021

The name of the field is not correct.

Translate
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 ,
Jun 23, 2021 Jun 23, 2021

Thank you Bernd.

 

Can you explain a little more?

 

I have always used "Today's Date". What am I missing?

Translate
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 ,
Jun 23, 2021 Jun 23, 2021

this.getField("Today's Date");

gives the value null.

That means that the script doesn't find the field in the document.

Translate
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 ,
Jun 23, 2021 Jun 23, 2021

Oh ok, thank you.

 

I found that it wasn't saving the field name that I was typing in. It seems to be staying now (see below)

CourtGinger_0-1624469596045.png

 

CourtGinger_1-1624469689832.png

 

But the date is still not auto-populating

 

Translate
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 ,
Jun 23, 2021 Jun 23, 2021

Look at the name of the field:

CourtGinger_1-1624469689832.png

Translate
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 ,
Jun 23, 2021 Jun 23, 2021

Oh! I didn't know that you had to name the script with the extra part after "Today's Date"

CourtGinger_2-1624473874525.png

Thank you!

 

Now, since some of our students will not be completing this document electronically, I will have to print this document for them to write in their information and I don't want the auto-populated date to show when I print it. 

 

Is there a way to do that?

 

Translate
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 ,
Jun 23, 2021 Jun 23, 2021

You have created a Adobe Sign form.

Translate
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 ,
Jun 23, 2021 Jun 23, 2021
LATEST

Yes, we will be sending it to students to them to complete electronically. 

 

But we also have students that struggle with technology or do not have a computer and internet at home to complete it so I will need to be able to print blank copies of the document so that students can hand write in their info.

 

So that is why I don't want the auto-populated date to show up on the blank printed copies because I am not sure what the date will be when students actually fill it out (I am going to print them ahead of time so we have them ready)

Translate
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 ,
Jun 23, 2021 Jun 23, 2021

Check that your field name is correct.

Translate
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