Jump to content

Javascript Curiosity

Ken Russ

Recommended Posts

Hi Peoples

I am new to the whole javascript thing and have a rather interesting problem happening.

I am trying to get Java to fill in a form field with todays date when it opens. 

I have created the script below from another help question, <https://community.gonitro.com/topic/139-current-date-in-a-form , which sort of works. What I am after is when the form opens in the top field java will put Created on: Todaysdate.

The code I have is 

var today = new Date();

event.value = util.printd ("Created on" dd mmm, yyyy", today);

This works great, it puts in the date correctly but for some reason it puts Creaaed on: 29 November, 2023.

If I change the word created to another word, it uses the word I put in there.

Is the word created a reserved word, if so how do I get around this.

I have tried putting this code in another field with exactly the same outcome.


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.