Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Date field question

Avatar

Level 2

I was wondering if it is possible to have one or multiple date fields change colors or become highlighted based off input from another date field.

What i have is a form that has an oldest possible date field and i want my other date fields on the form to become highlighted if an older date then the oldest possible date field is selected.

Thanks

1 Reply

Avatar

Level 10

Hi,

this isn't complicated to realize:

Just add a small FormCalc script into the possible oldest date field exit event.

In this example the font color of the Datefield2 will change to red if the selected date is before August the 1st 2014.


var dateFormat = "MM/DD/YYYY"


if (Date2Num($.formattedValue,  dateFormat) lt Date2Num("08/01/2014",  dateFormat) ) then


  DateField2.font.fill.color.value = "255,0,0"


  DateField2.caption.font.fill.color.value = "0,0,0"


else


  DateField2.font.fill.color.value = "0,0,0"


  DateField2.caption.font.fill.color.value = "0,0,0"


endif


The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now