0
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }
    var newValLength = newValue.toString().length;
    if (newValLength != 5) {
        g_form.showFieldMsg('u_zip_code', 'Please add a 5 digit Zip Code', 'error');
    }
    var re = /^[0-9]*$/;
    if (!re.test(newValue)) {
        g_form.showFieldMsg('u_zip_code', 'Please add a valid zip code', 'error');
        return false;
    }
    return true;
}
Zip Code Validation on client Script ServiceNow
admin Changed status to publish December 19, 2023