Skip navigation
ESMITH.CU
Currently Being Moderated

Script to save file name as text field AND timestamp

Aug 13, 2012 11:05 AM

Tags: #autosave #timestamp #submit_by_email

Hello Adobe Wizards!

 

I'm (BRAND) new to Javascript, and I've gleaned quite a bit from this forum.  However, I'm still in the dark about lots.

 

Here's what I'm going for.  I have a "submit" button at the bottom of a form with looots of editable fields.  2 very important fields are "Name" and "SID"- for the name and ID number of the client.  I want the submit button to save the .pdf with the file name " 'Name', 'SID', TimeStamp"  where TimeStamp is a automated timestamp created at the time the form is submitted.

 

It would also be helpful if I could have the "submit" button enter the same file name actually on the form, in a text field I have on the top of the first page.  I have started that script but can only figure out how to include the SID field (see below). I'm swimming in code that I don't understand!! Someone- throw me a life jacket!

 

--

Here's my best crack at the script that includes the SID and TimeStamp in a text box at the top of my form.

 

// get the current date object
 var oNow = new Date();
 // get the milliseconds from the Epoch date
 var fTime = oNow.getTime();
 // trim to seconds
var fSeconds = fTime / 1000;
 // truncate to seconds
 var fTimeStamp = Math.floor(fSeconds)
   // set the SID field to a variable
 var fSID = this.getField('SID');
  // populate the 'TimeStamp' field's value
 this.getField('TimeStamp').value = fSID + fTimeStamp;

 

Thank you all!

 
Replies

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