I have a Sharepoint online site with classic view. Originally, system will check if the upload file is not blank and the filename without special characters when user upload the file in doc library. Error message will show when a blank file or file with invalid filename is upload.
However we found that the validation does not work any more as it is allowed user to upload blank file or file with invalid filename.
I have taken a look on the coding and below codes are found:
<script type="text/javascript">
//<![CDATA[
var ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_ctl00 = document.all ? document.all["ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_ctl00"] : document.getElementById("ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_ctl00");
ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_ctl00.controltovalidate = "ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_InputFile";
ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_ctl00.focusOnError = "t";
ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_ctl00.errormessage = "You must specify a value for the required field.";
ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_ctl00.display = "Dynamic";
ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_ctl00.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_ctl00.initialvalue = "";
var ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_ctl01 = document.all ? document.all["ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_ctl01"] : document.getElementById("ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_ctl01");
ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_ctl01.controltovalidate = "ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_InputFile";
ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_ctl01.errormessage = "The file name is invalid or the file is empty. A file name cannot contain any of the following characters: \\ / : * ? \" < > | # %";
ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_ctl01.display = "Dynamic";
ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_ctl01.evaluationfunction = "CustomValidatorEvaluateIsValid";
//]]>
</script>
May I know if anyone has the same issue before and how to fix the issue?
