From 1872920bb07a6977fea09f345ecd08a35b6cd495 Mon Sep 17 00:00:00 2001 From: spnegi <150329891+spnegi@users.noreply.github.com> Date: Thu, 9 Oct 2025 19:09:00 +0530 Subject: [PATCH 1/2] Create Allow 10digit Fax Number.js --- .../Allow 10digit Fax Number.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Client-Side Components/Catalog Client Script/Allow 10digit Fax Number/Allow 10digit Fax Number.js diff --git a/Client-Side Components/Catalog Client Script/Allow 10digit Fax Number/Allow 10digit Fax Number.js b/Client-Side Components/Catalog Client Script/Allow 10digit Fax Number/Allow 10digit Fax Number.js new file mode 100644 index 0000000000..95f5371773 --- /dev/null +++ b/Client-Side Components/Catalog Client Script/Allow 10digit Fax Number/Allow 10digit Fax Number.js @@ -0,0 +1,12 @@ +function onChange(control, oldValue, newValue, isLoading) { + if (isLoading || newValue == '') { + return; + } + + var faxRegex = /^\d{10}$/; //allow only 10 digit in fax number field + if (!faxRegex.test(newValue)) { + g_form.addErrorMessage('Please enter a valid 10-digit fax number'); + g_form.clearValue('fax_num'); + } + +} From 2630c33d56a37501c36d01ec2ff620e422b44d42 Mon Sep 17 00:00:00 2001 From: spnegi <150329891+spnegi@users.noreply.github.com> Date: Thu, 9 Oct 2025 19:12:17 +0530 Subject: [PATCH 2/2] Create README.md --- .../Catalog Client Script/Allow 10digit Fax Number/README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Client-Side Components/Catalog Client Script/Allow 10digit Fax Number/README.md diff --git a/Client-Side Components/Catalog Client Script/Allow 10digit Fax Number/README.md b/Client-Side Components/Catalog Client Script/Allow 10digit Fax Number/README.md new file mode 100644 index 0000000000..c896360bac --- /dev/null +++ b/Client-Side Components/Catalog Client Script/Allow 10digit Fax Number/README.md @@ -0,0 +1,2 @@ +This script ensures that the fax number entered consists of exactly 10 digits. +Any input that doesn’t meet this requirement — such as numbers with fewer or more digits, letters, or special characters — will be automatically rejected to maintain proper validation and data consistency.