Adobe LiveCycle Data Field | Community
Skip to main content
June 27, 2022
Question

Adobe LiveCycle Data Field

  • June 27, 2022
  • 1 reply
  • 749 views

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.

1 reply

SantoshSai
Community Advisor
Community Advisor
June 27, 2022

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

Santosh Sai
Aitor_Author
June 28, 2022

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