Skip to main content
Participant
May 30, 2018
Answered

Form - Button inserts username and date

  • May 30, 2018
  • 1 reply
  • 1340 views

Hello,

I'm creating a form that includes a button that will automatically enter in the users Windows ID and current date and I'm having trouble finding a javascript on how to do this.

Any help that could be provide would be greatly appreciated.

Thanks,

Nathan

This topic has been closed for replies.
Correct answer try67

First thing to know is that it's JavaScript, not Java. Similar names, but very different languages.

You can use this code:

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

1 reply

try67
Community Expert
Community Expert
May 30, 2018

The latter is easily done, the former not so much. You can access the "Login Name" property of the identity object, but it requires installing a script on the user's local machine.

NathanDFAuthor
Participant
May 30, 2018

Thanks. Any advise on how to do the date? This is the first form I'm creating with a button and I'm not too savvy with Java.

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
May 30, 2018

First thing to know is that it's JavaScript, not Java. Similar names, but very different languages.

You can use this code:

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