Skip to content

Commit 1872920

Browse files
authored
Create Allow 10digit Fax Number.js
1 parent 7661a0a commit 1872920

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
function onChange(control, oldValue, newValue, isLoading) {
2+
if (isLoading || newValue == '') {
3+
return;
4+
}
5+
6+
var faxRegex = /^\d{10}$/; //allow only 10 digit in fax number field
7+
if (!faxRegex.test(newValue)) {
8+
g_form.addErrorMessage('Please enter a valid 10-digit fax number');
9+
g_form.clearValue('fax_num');
10+
}
11+
12+
}

0 commit comments

Comments
 (0)