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.

Restricting date field from custom entry

Avatar

Former Community Member

Hi,

The date field on my form allows custom entry.

I want my date field to be interactive but don't allow custom entry of data.

How should i achieve this?

Thanks,

VJ.

2 Replies

Avatar

Level 4

You could set your date to "auto populate" with today's date and then set the field value to "Read Only". This way the date would be whatever today's date is when the form opens, but the user would not be able to change it. You would auto populate the date by bringing onto your form the date object, going to "Tools", "Action Builder" and creating a new action with the Condition "When form (and select Form1) has finished loading, and choose the Result of "Set the value of "DateTimeField1" to today's date." OK, then set the field value to "Read Only" and it can't be changed.

We use this because some of our forms require an official "Date of Notice" to be whatever date the form is printed out.

Hope this helps.

Avatar

Former Community Member

Hi,

Thanks for the prompt reply.

My date field is not readOnly. It is User-Entered.

So, in this case is it not possible to restrict user from custom entry?

Thanks,

VJ