• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Auto Date and Time

New Here ,
Feb 08, 2016 Feb 08, 2016

Copy link to clipboard

Copied

Hello experts,

I am trying to create a web form and the idea is whenever someone fills the form and submits it the time of the submission should be recorded and should be received automatically, I tried with almost all the tutorials available online...! very unfortunately I am not getting what I want..! I am not good at Java script or any other coding still spent plenty of time to figure this out and failed...! Truly will be very much grateful if some expert could help me out..! Thank you very much

TOPICS
Acrobat SDK and JavaScript , Windows

Views

1.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 11, 2016 Feb 11, 2016

Sorry, it was a mistake in the code I provided above. It needs to be:

this.getField("SubmitDate").value = util.printd("mm/dd/yyyy HH:MM", new Date());

The message you see was added by a third-party script you applied to the file. You can remove it via Document JavaScripts.

Votes

Translate

Translate
Community Expert ,
Feb 09, 2016 Feb 09, 2016

Copy link to clipboard

Copied

Is this a PDF form?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 09, 2016 Feb 09, 2016

Copy link to clipboard

Copied

Hello yes it's a PDF form, as I believe once the form is being filled and submitted we could print the filled form for our records and we would also would know at what time the form has been submitted..! In other types of forms we would only get the data in an email..right?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 09, 2016 Feb 09, 2016

Copy link to clipboard

Copied

OK. Do you want the date and time to be recorded in a field?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 09, 2016 Feb 09, 2016

Copy link to clipboard

Copied

Thanks for the prompt reply ☺ yes that's how we need as the for the nature of the business we are in need of tracking the date and time though

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 09, 2016 Feb 09, 2016

Copy link to clipboard

Copied

OK, so before your Submit Form action add an Execute JavaScript action with this code (let's say the field is called "SubmitDate"):

this.getField("SubmitDate") = util.printd("mm/dd/yyyy HH:MM", new Date());

It's probably a good idea to make that field read-only, or even hidden, so the user can't change its value themselves.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 09, 2016 Feb 09, 2016

Copy link to clipboard

Copied

Thank you so much for your prompt reply I will give it a try tonight and post the result sooner

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 09, 2016 Feb 09, 2016

Copy link to clipboard

Copied

Hello thanks for the help, and followed your guidance still could not figure out or it's not working Pls see the attached images that might help you to find out what am I doing wrong! Thank you jc2.JPGJC.JPGjc3.JPG 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 10, 2016 Feb 10, 2016

Copy link to clipboard

Copied

Why did you place the code as the Will Print action of the document, instead of the Mouse Up action of the Submit button?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 10, 2016 Feb 10, 2016

Copy link to clipboard

Copied

Hi I am sorry, I am sure how to go about doing it...! I tried the property of Submit btn could not find any area to input the code, could you pls. walk me through

Thank you so much for your patience.

submit.JPG

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 10, 2016 Feb 10, 2016

Copy link to clipboard

Copied

Under "Select Action" select "Run a JavaScript" and then paste the code into the window that opens.

Make sure this action is performed before the Submit Form action, by moving it up the list.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 10, 2016 Feb 10, 2016

Copy link to clipboard

Copied

Hi thanks again, I believe I did it correct this time still no working pls. weather this is OK - Thanks jc3.JPG

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 10, 2016 Feb 10, 2016

Copy link to clipboard

Copied

It looks OK... Are there any error messages in the JS Console (Ctrl+J) when you click the button? Can you share the file?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 10, 2016 Feb 10, 2016

Copy link to clipboard

Copied

I could not recognize any error, by all means as I am working on a test file..! by the way how to attach this file? as its not yet on the actual server - Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 10, 2016 Feb 10, 2016

Copy link to clipboard

Copied

Hello sorry by the way I am getting this warning message pls have a look and I singed up a dropbox ac and the file is inside for your kind perusal

https://www.dropbox.com/s/10m9gwjdhj8el8w/form.pdf?dl=0

warning.JPG

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 11, 2016 Feb 11, 2016

Copy link to clipboard

Copied

Sorry, it was a mistake in the code I provided above. It needs to be:

this.getField("SubmitDate").value = util.printd("mm/dd/yyyy HH:MM", new Date());

The message you see was added by a third-party script you applied to the file. You can remove it via Document JavaScripts.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 11, 2016 Feb 11, 2016

Copy link to clipboard

Copied

LATEST

Wow thank you so much for the help, I mean it...! it's perfectly working and I so happy and grateful to you - Thank You Again

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines