Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Events Question

Avatar

Level 4

Hi folks,

I have some general question about where to place my custom script.

I want to compare 2 dates fields in my form(checking if the start date is not greater than the end date).

Where should I place my code if I want to make this check and also to tell the user to select normal dates range?

Thank you,

Yair

1 Reply

Avatar

Level 10

You can place in the exit event of the date fields to compare the dates..

D1 and D2 are two date fields on my form..

Language set to FormCalc

Event set to Exit.

if(D1.rawValue ne null and D2.rawValue ne null) then
if(D1.rawValue>D2.rawValue) then
  $host.messageBox("More");
endif
endif

Thanks

Srini