From e5bc5b95568a586df01c4e42324c4cc8ef6f98bc Mon Sep 17 00:00:00 2001 From: Willem Date: Sun, 12 Oct 2025 14:31:59 +0200 Subject: [PATCH] Delete Client-Side Components/Catalog Client Script/Special Characters directory Removed this as it is a copy of /code-snippets/tree/f1f5267a806b39e8c63703f8b4274a850c11448f/Specialized%20Areas/Regular%20Expressions/Check%20for%20special%20characters It is a regex not in the regex folder. --- .../Special Characters/README.md | 4 ---- .../Special Characters/script.js | 15 --------------- 2 files changed, 19 deletions(-) delete mode 100644 Client-Side Components/Catalog Client Script/Special Characters/README.md delete mode 100644 Client-Side Components/Catalog Client Script/Special Characters/script.js diff --git a/Client-Side Components/Catalog Client Script/Special Characters/README.md b/Client-Side Components/Catalog Client Script/Special Characters/README.md deleted file mode 100644 index 90fd463a18..0000000000 --- a/Client-Side Components/Catalog Client Script/Special Characters/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Validate Special Characters for a catalog variable - -With this onChange catalog client script you can validate if there are any special characters present in the input given by user in a particular field and show an error message below the field and clear the field value. Although we have other methods to do this, it is much easier and you can customize your error message. - diff --git a/Client-Side Components/Catalog Client Script/Special Characters/script.js b/Client-Side Components/Catalog Client Script/Special Characters/script.js deleted file mode 100644 index edd1262e11..0000000000 --- a/Client-Side Components/Catalog Client Script/Special Characters/script.js +++ /dev/null @@ -1,15 +0,0 @@ -function onChange(control, oldValue, newValue, isLoading, isTemplate) { - - if (isLoading || newValue === '') { - return; - } - - //In the below regex, you can add or remove any special characters as per your requirement - var special_chars = /[~@|$^<>\*+=;?`')[\]]/; - - if (special_chars.test(newValue)) { - g_form.clearValue(''); - g_form.showErrorBox('','Special Characters are not allowed'); //you can change the error message as required. - } - -}