Validation help [ColdBox 3.8.1]

Hi all,

I’m have a slight problem where I want to validate for a date. The date is not required but if there is a value it must be a date.

SCDate={required=‘false’, type=‘date’, Message=‘Date must be in mm/dd/yyyy format’},

When this fails validation, I would l like that message returned to the user. However I’m not sure I have the syntax right.

Hi Mallory–

Use “typeMessage” instead of “message”.

The syntax for messages is: {constraintName}Message = “My Custom Message”;

Hope that helps!

Thanks! That was it.