Skip to content

Commit 9684562

Browse files
authored
Create validateLength.js
1 parent 185759c commit 9684562

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Client Script: Validate Length
2+
// Table: sys_user
3+
// Type: onChange
4+
// Field: phone
5+
6+
function onChange(control, oldValue, newValue, isLoading) {
7+
if (isLoading || newValue === '') return;
8+
9+
if (newValue.length>12) {
10+
g_form.showFieldMsg('phone', 'Phone number should have a maximum of 12 charecters', 'error');
11+
g_form.setValue('phone', '');
12+
}
13+
}

0 commit comments

Comments
 (0)