Skip to content

Commit 2c4f938

Browse files
Create README.md
Readme file is for instruction or usages of code.
1 parent 70b1728 commit 2c4f938

File tree

1 file changed

+14
-0
lines changed
  • Client-Side Components/Client Scripts/Phone Number Validation

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
We are building a form in ServiceNow where a user must enter their phone number.
2+
The requirement is that only valid Indian mobile numbers should be accepted. A valid number should:
3+
4+
Optionally start with 0 or 91
5+
6+
Be exactly 10 digits long
7+
8+
Start with digits 6, 7, 8, or 9
9+
10+
If the user enters anything invalid, the form should not be submitted, and an error message should be shown.
11+
12+
g_form.getValue → gets the phone field value.
13+
Regex → allows numbers like 9876543210, 0919876543210, 919876543210.
14+
Validation → If the value is invalid, shows alert and blocks submission.

0 commit comments

Comments
 (0)