Skip to content

Commit

Permalink
urgent fix (validation orcid id)
Browse files Browse the repository at this point in the history
  • Loading branch information
neerajdarwin committed Oct 7, 2024
1 parent 812220a commit 958e3ee
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ProjectApplication/project_core/static/js/wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 958e3ee

Please sign in to comment.