Skip to main content
Jun 27, 2022 2:48 PM UTC
Question

Adobe LiveCycle Data Field

Hello everyone,

 

I've created a date field and I need to validate the date so that it is after 01-01-2022.

 

If the user enters a date earlier than the date, it should give an appropriate message and the value of the date field should be null.

 

Please help.

 

Thanks

 

Aitor

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

SantoshSai
Community Advisor
Community Advisor
Jun 27, 2022 8:25 PM UTC

Hi @aitor_ ,

Try this, 

var entryDate = date2num($.formattedValue, "MM/DD/YYYY")
var currentDate = date()
if (entryDate lt date()) then
$host.messageBox("Date cannot be in the past", "Date in the past", 0, 0)
else if (entryDate gt currentDate) then
//do Something
endif

Hope that helps!

Regards,

Santosh

Translate
Santosh Sai
Aitor_Author
Jun 28, 2022 8:57 AM UTC

Hi @santoshsai ,

 

I have tried to apply the code but How can I specify that it only correctly validate dates from 01-01-2022?

 

Thanks a lot,

 

Aitor

Translate