How can you make a field only accept numbers dynamically?

cwli22
Tera Contributor

Hi, I'm sort of new to ServiceNow and I'm trying to make a record producer field only accept numbers. I've tried an onChange() client script and validation regex but they only work if I click off the field. I was wondering how I could dynamically validate a number only field. Ideally it would only accept number key presses and ignore letter key presses. Thanks.

1 REPLY 1

Mike_R
Kilo Patron
Kilo Patron

This is available OOTB. Just set the validation regex to 'Number'.

Mike_R_0-1696546291536.png