Skip to content

Commit 430b61d

Browse files
Create Readme.md
1 parent 3b8c8b2 commit 430b61d

File tree

1 file changed

+35
-0
lines changed
  • Client-Side Components/Client Scripts/Whitespace Validation

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Whitespace Validation — Client Script (ServiceNow)
2+
Overview
3+
4+
This Client Script ensures that a field does not contain any whitespace characters. It validates user input in real-time and provides immediate feedback by displaying an inline error message directly below the field. Invalid input is cleared automatically to enforce proper data entry.
5+
6+
Features
7+
8+
Prevents any spaces in the field value.
9+
10+
Displays field-level error messages below the input field.
11+
12+
Automatically clears invalid input for user correction.
13+
14+
Simple, lightweight, and does not use regex or getLabelOf.
15+
16+
Works dynamically for any field where the Client Script is applied.
17+
18+
Usage Instructions
19+
1. Create the Client Script
20+
21+
Navigate to System Definition → Client Scripts.
22+
23+
Click New to create a new Client Script.
24+
25+
2. Configure the Script
26+
27+
Name: Whitespace Validation
28+
29+
Table: Select the target table (e.g., sys_user)
30+
31+
Type: onChange
32+
33+
Field: Select the field to validate (e.g., username, phone)
34+
35+
Active: Check this box

0 commit comments

Comments
 (0)