From 76a13cfa2686dc4ef59904e02366418547a7d260 Mon Sep 17 00:00:00 2001 From: Ravi Chandra <149189748+ravichandra1998g@users.noreply.github.com> Date: Tue, 28 Oct 2025 22:11:39 +0530 Subject: [PATCH] Revert "Check attchment type and count files attached on Catalog Form (#2581)" This reverts commit 1ba7479e4361ea3eb00955d8489e72341cf12d8e. --- Check Attachment | 3 --- CheckAttachmentFiletypr.js | 30 ------------------------------ 2 files changed, 33 deletions(-) delete mode 100644 Check Attachment delete mode 100644 CheckAttachmentFiletypr.js diff --git a/Check Attachment b/Check Attachment deleted file mode 100644 index 2d57044521..0000000000 --- a/Check Attachment +++ /dev/null @@ -1,3 +0,0 @@ -An onSubmit Client script that checks whether only one file is attached and also file type should be .doc, .pdf or .txt. Otherwise form will not be submitted and required error message will be displayed to user. - -Note: Check this property - glide.attachment.extensions diff --git a/CheckAttachmentFiletypr.js b/CheckAttachmentFiletypr.js deleted file mode 100644 index b134145dd1..0000000000 --- a/CheckAttachmentFiletypr.js +++ /dev/null @@ -1,30 +0,0 @@ -function onSubmit() { - var arr = []; - var extension1 = '.txt'; - var extension2 = '.pdf'; - var extension3 = '.docx'; - var names = this.document.getElementsByClassName('get-attachment ng-binding ng-scope'); - for (var i = 0; i < names.length; i++) { - var val = names[i].innerHTML; - arr.push(val.toString()); - } - - var countRequired = 1; - if (window == null) { - if (this.document.getElementsByClassName('get-attachment').length != countRequired) { - g_form.addErrorMessage('You can add only one attachment'); - return false; - } - } - - for (var j = 0; j < arr.length; j++) { - if ((arr[j].indexOf(extension1) > -1) || (arr[j].indexOf(extension2) > -1) || (arr[j].indexOf(extension3) > -1)) { - return true; - } else { - g_form.addErrorMessage('Unsupported file format. Please attach files with extensions .txt, .pdf, .doc'); - return false; - } - - } - -}