function onChange(control, oldValue, newValue, isLoading) { if (isLoading || newValue == '') { return; } var regexNumber = /^[+]?\d*$/; if(!regexNumber.test(newValue)){ alert('Please enter numeric value'); g_form.setValue('num',''); } }
Regex to allow only numeric data in a single line field Client Script ServiceNow
Expert Asked question July 18, 2023