Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Lock today field afer save

pg38905522
Level 2
Level 2

Hi,

I have a  form with  java script. When the form is open the script fill the today date.

When the document is reopened with the date pre-filled, it dont change.

I put the code in the postsave event, but the date doesnt lock. 

Any Idea ?

if (this.getField ("DateDemand").value =="")

{

this.getField ("DateDemand").defaultValue = util.printd ("mm/dd/yyyy", new Date());

this.getField ("DateDemand").value = this.getField ("Today").defaultValue;

}

Regards

Pierre

3 Replies
radzmar
Level 10
Level 10

Hi,

you syntax is "wrong", because the JavaScript in Designer is different to that you use in Acrobat.

Add, the following In the preSave event of your date field.


if (this.isNull) {


    this.rawValue = util.printd ("mm/dd/yyyy", new Date());


}


pg38905522
Level 2
Level 2

HI,  i try it but the day is changing.

Anything else ??

pg38905522
Level 2
Level 2

OK,

I apoligize !

I was not loking after the pdf is save.

Everythink OK

Thanks !!

PGAG