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.

Date Field - custom entry

Avatar

Level 1

Hello,

I'm trying to create a date field in LC which can only be selected from the drop down calendar.  I would like to disable keyboard entries both before and after the date selection.  Is anyone able to assist?

Thanks.

2 Replies

Avatar

Level 10

You can check the length of the strings during the change event.

A keystroke always has the length 1 and can be filtered.

Add this sript into the change event of your date field:


xfa.event.change = xfa.event.change.length > 1 ? xfa.event.change : "";


Pasting from the clipboard is still possible, but I don't think anyone ever will enter a date this way.