I assume it's in the resource form, but, when I add or edit a resource with a DOI that itself produces a 404, nothing happens and the resource is added/edited without problems.
Mark
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I ended by adding myself a JS validation. Try to refresh the resource form and try again. Now you should see the DOI input box with a red border in case of error.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ahhhh. Looking at the code, I now understand what it does. Entering '10.30app14031038' does produce the warning. So it's working as you intended.
I thought DOI validation was about checking that the DOI address existed. '10.30/app14031038' (which is validated by your code) is an address that does not exist.
Mark
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Then all is well. I guess if we wanted to check in the URL exists (and for other elements too, not just DOI), then, after validation, we could use something like:
varrequest=newXMLHttpRequest();request.open('GET','http://www.mozilla.org',true);request.onreadystatechange=function(){if(request.readyState===4){if(request.status===404){alert("Oh no, it does not exist!");}}};
Mark
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It is not uncommon that a university or a company does not have the right to send requests externally without going through a proxy. This is even very often the case. Also this makes this feature more difficult to implement than that. I don't want to venture into that territory.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Mark,
I added a JS/PHP functions to validate DOI numbers.
Could you
Regards,
Hi Stéphane,
I assume it's in the resource form, but, when I add or edit a resource with a DOI that itself produces a 404, nothing happens and the resource is added/edited without problems.
Mark
HTTP 404 error ? Odd.
I ended by adding myself a JS validation. Try to refresh the resource form and try again. Now you should see the DOI input box with a red border in case of error.
Ahhhh. Looking at the code, I now understand what it does. Entering '10.30app14031038' does produce the warning. So it's working as you intended.
I thought DOI validation was about checking that the DOI address existed. '10.30/app14031038' (which is validated by your code) is an address that does not exist.
Mark
Yes, it doesn't check if the document exists. Just the syntax, which is the minimum.
Then all is well. I guess if we wanted to check in the URL exists (and for other elements too, not just DOI), then, after validation, we could use something like:
Mark
It is not uncommon that a university or a company does not have the right to send requests externally without going through a proxy. This is even very often the case. Also this makes this feature more difficult to implement than that. I don't want to venture into that territory.
Understood.