2 Replies Latest reply on Mar 1, 2012 9:57 AM by KJSTech

    How can I populate a date field when document is signed?

    KJSTech Level 1

      I have 4 digital signature fields in a PDF form.  Next to each signature field is a date field (m/d/yyyy format).  I would like it so when the user signs the signature box that the date field next to it populates with todays date, then changes to read only (so it cannot be altered).


      In Adobe Acrobat Pro 9 I have this form and it has the following fields











      The Signature fields trigger a Topaz.GemSignPlus driver where the end user will be signing on an electronic signature pad.


      How can I use Javascript to detect when one of those Signature fields is populated and then fill in the date to the approrpiate date field?  I tried creating boolean variables initialized as false for each sig field.  Then when the signature is done I try to change it to true, but for whatever reason my javascript detecting the value doesn't do anything.


      I've searched the net endlessly for this solution.  I can't believe I'm having such a hard time finding an answer.  I mean how many places do you go where they ask you to "Sign and date here".  Every signature based document I've ever seen also requires a date.


      Anyway here's what I have.  In Document JavaScript functions I have a script name called populate date:

      function populatedate()
      var bSignature1 = new Boolean();
      var bSignature2 = new Boolean();
      var bSignature3 = new Boolean();
      var bSignature4 = new Boolean();

      if (bSignature1) {
          DateField1.value = util.printd ("m/d/yyyy", new Date());

      if (bSignature2) {
          DateField2.value = util.printd ("m/d/yyyy", new Date());

      if (bSignature3) {
          DateField3.value = util.printd ("m/d/yyyy", new Date());

      if (bSignature4) {
          DateField4.value = util.printd ("m/d/yyyy", new Date());



      In each signature field I have under the Signed tab "This script executes when field is signed:

      var bSignature1 = new Boolean(true);


      I'm trying to change it to true see.  My thinking is if its true than DateField1.value should print the m/d/yyyy in it from the built in Date() function.


      But maybe I am not getting this context correct.  I am new to Javascript in Adobe.