How to manage different “current dates” in PDF form with Javascript

Hey guys,

I try to design a pdf form for employees, so employee A can request something from employee B. Employee A fills out the form, signs it and send it to employee B. After employee B approved the form, he signs the pdf form and send it back to employee A.

I figured out how to automatically fill in the current date while employee A is filing the application. The date will stay and can’t be edited anymore.

My problem now is: I need another date field for employee B. When he opens the form, the other date field should automatically fill in the current date. So I need two current date fields but the second only fills in after the first is filled and the file is saved or re-opened.

Is there a way to do so?

Can Javascript fill in the date when the field is locked because of the signing?

The date field for employee A is called “datum” and for employee B “datum-aktuell”.

Thank you for your help and I tried to fill the code with JSFiddle. Hopefully it works. Here is the link: https://jsfiddle.net/hptfg8wo

Are you using a status for the form?
eg)

  • Submitted

  • Signed

  • Completed

You mean in my js? I tried to give it a condition when it should start but it did not work.

I am talking about a workflow