Skip to content

Commit

Permalink
remove url validation option (#608)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdmayhew authored Oct 30, 2024
1 parent 1c8c977 commit 1e10399
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions app/assets/javascripts/accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ function orcidValidation() {
var orcidID = document.getElementById("publication_creators_orcid_id").value;
var orcidIDBool = isOrcidIdValid(orcidID);
console.log(orcidIDBool);
var orcidIDValue = 'The orcid ID is not valid.';
var orcidIDValue = 'Please enter a correctly formatted ORCID ID without the URL.';

if (orcidID !== "") {
if (!orcidIDBool) {
Expand Down Expand Up @@ -388,13 +388,9 @@ function finalPubVerValidation() {
}

function isOrcidIdValid(orcidID) {
//no url
var orcidIdRegex = /^\d{4}\-\d{4}\-\d{4}\-\d{4}$/;
// with url
var orcidIdRegex2 = /https:\/\/orcid\.org\/[0-9]+-[0-9]+-[0-9]+-[0-9]+$/;

if (orcidIdRegex.test(orcidID) || orcidIdRegex2.test(orcidID)) {
console.log("idk one of these worked lol");
if (orcidIdRegex.test(orcidID)) {
return true;
} else return false;
}
Expand Down

0 comments on commit 1e10399

Please sign in to comment.