Friday, May 6, 2011

JavaScript to Save As with current date

I have a time sheet form named Timesheet Paperless.pdf I send this form to an employee and tell them to fill their name and employee number in the form. I then ask them to go to File>Save As and name the form INTIALS_TS.pdf . I now would like to a have button with in the form that will open a Save As dialog with the filename INITIALS_TS CurrentDate.pdf under My Documents/Work Files/Time Sheets/. So every new pay period they would click the save button on the form to save the file under the time sheets folder with their intials and the current date the button was pushed. How can I do this in JavaScript?

From stackoverflow
  • Sorry, there's no way to do that with JavaScript.

    The closest solution that comes to mind is open a link to a server-side script that outputs the PDF along with a content-disposition header.

    Content-Disposition: attachment; filename=INITALS_TS.pdf
    

0 comments:

Post a Comment