From 958e3ee41786b2d679e18c451d4144416090b0c1 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Mon, 7 Oct 2024 13:30:34 +0530 Subject: [PATCH] urgent fix (validation orcid id) --- ProjectApplication/project_core/static/js/wizard.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ProjectApplication/project_core/static/js/wizard.js b/ProjectApplication/project_core/static/js/wizard.js index 680a2671..adaa5be9 100644 --- a/ProjectApplication/project_core/static/js/wizard.js +++ b/ProjectApplication/project_core/static/js/wizard.js @@ -90,10 +90,14 @@ $(document).ready(function () { } function validateOrcid(orcid) { - var orcidRegex = /^(\d{4}-){3}\d{4}$/; - return orcidRegex.test(orcid) && orcid !== "0000-0002-1825-0097"; + if (typeof orcid !== 'string') { + return false; // Input is not a valid string } + var orcidRegex = /^(\d{4}-){3}(\d{3}[0-9X])$/; // Updated regex to allow 'X' + return orcidRegex.test(orcid) && orcid !== "0000-0002-1825-0097"; // Check format and exclude specific ORCID +} + function addValidation(callback) { errorMessages = []; // Clear error messages