Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Scripting for a pattern validation message

Avatar

Level 1

I have a date/time field that is read only but becomes required if the user types something in a different field. The validation pattern works because I set those before I turned the field to read only but the validation pattern message is just the default again (the custom message I had typed in disappears when the field is changed to read only). Does anyone know how to set the validation pattern message through javascript? I can't seem to figure it out.

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 5

You can access the validation pattern message property through script using

DateTimeField1.validate.message.formatTest.value

The scripting validation pattern message is done using

DateTimeField1.validate.message.scriptTest.value

View solution in original post

2 Replies

Avatar

Correct answer by
Level 5

You can access the validation pattern message property through script using

DateTimeField1.validate.message.formatTest.value

The scripting validation pattern message is done using

DateTimeField1.validate.message.scriptTest.value