Skip to main content
Participant
August 30, 2016
Answered

Add date and time to a text field when form is submitted

  • August 30, 2016
  • 1 reply
  • 679 views

Is there a way to add the current date and time to a text field when the user is clicking the submit form button?

I created a custom submit form button and am not using the distribute process to collect results and would like to have a time stamp of when the form was submitted.

Thanks!

This topic has been closed for replies.
Correct answer try67

Sure. Before your submit command add an Execute JavaScript command with this code:

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

Adjust the field name and/or date pattern as required.

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
August 30, 2016

Sure. Before your submit command add an Execute JavaScript command with this code:

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

Adjust the field name and/or date pattern as required.

Participant
August 30, 2016

Perfect Thank you!!!