Date masked input field

Eduardo Paredes
Giga Guru

Hello,

We created a custom configurable workspace. In that workspace, we have a form that displays a date field, and we got a requirement to allow users to enter a date by typing only numbers (e.g. 02072023) and the input must be automatically changed to 02-07-2023 as the user types the date to pass the date validation since the date needs to be entered in MM-DD-YYYY format or to be selected from the calendar control.

I found this Service Catalog Input Masking - ServiceNow Community article describing how to leverage external JS libraries in the service portal, but I haven't been able to find a solution on how to implement this requirement in the workspace.

We tried a combination of on change and on submit client scripts to validate the date field, but it doesn't "autocorrect" the date format as the user enters the date, which is what they would like to see.

 

Has anyone figured out how to implement masked input fields in configurable workspace?

Any help is greatly appreciated.

 

Thank you all.

0 REPLIES 0