Skip navigation
Giagraphix
Currently Being Moderated

How do you lock a submittable form date?

Aug 10, 2012 11:35 AM

Tags: #date_lock_submit

Help!

 

I'm at my wits end. I need my XFDFs to preserve the date the form was submitted, but I'm having no luck. I'm using this script:

 

var f = this.getField("form_date");

f.value =

util.printd("mm/dd/yyyy", new

Date ());

 

This script works on one submittable form our customers complete in a browser, but no matter what I do when I add it to other submittable forms (Acrobat PDF 9 Pro; not LiveCycle), it doesn't work.

 

I've tried variations of this script in the form_date field and Page Open action, but it either freezes one date in the form forever, or when the XFDFs open they open with today's date.

 

My AcroForm PDFs are password secured. They can be filled and submitted, but not copied. They can be printed once filled, but not to PDF. Each PDF has an accompanying Admin PDF and MMT file that allows the submitted XFDFs to open as a filled PDF when in the same folder as the XFDF. 

 

I'm not a programmer - I've inherited these forms and am learning as I go, so any advice you can give me will be much appreciated. I'm desperate for a solution as soon as possible.

 

Thank you so much!

 
Replies
  • George Johnson
    9,209 posts
    Aug 11, 2002
    Currently Being Moderated
    Aug 10, 2012 1:06 PM   in reply to Giagraphix

    Normally, that code would be placed in a location so that it executes when the form is opened. It can be placed in a document-level JavaScript (outside of a function definition) or in the initial page's Page Open event.

     

    When you receive the XFDF and want to populate a blank form, it should be a revised version that does not include this bit of code so that the date from the XFDF isn't overwritten by the script.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 10, 2012 2:09 PM   in reply to Giagraphix

    How about

     

    var f = this.getField("form_date");

    if (f.valueAsString == "") {

         f.value = util.printd("mm/dd/yyyy", new Date ());

    }

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points