Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Script to display calendar on date field enter

Avatar

Level 9

Is there a script to display the calendar when the user enters (tabs to) the date field?

9 Replies

Avatar

Former Community Member

var date = new Date();

this.rawValue = date;

this should work.

-Vijay

Avatar

Level 9

In the JavaScript Enter event I added,

var date=new Date();

this.rawValue = date;

but when entering that field it reads "Empty".

Avatar

Former Community Member

it will work on change or click event of data field.

Avatar

Level 9

I tried your code in the date click event and the calendar does not display when I click into the date field.

Avatar

Level 9

Anyone know how to get the calendar to dispplay when entering the date object field?

Avatar

Former Community Member

Date1.JPGDate2.JPG

the same script works fine please see the screen shot attached.

Avatar

Level 9

vshanker,

I'm sorry. I have tried the script that is working for you and for the life of me, I can not get the same results. I click into the date field and nothing happens. This is what I entered:

Capture1.PNG

What could be different or what am I missing? Thanks for your patience with this.

-Don

Avatar

Former Community Member

Not sure why it is not working,

try to check the enforce script option as below.Date1.JPG

Avatar

Level 9

Yes, mine is set exactly as yours.