This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function checkFile(file) { | |
var extension = file.substr((file.lastIndexOf('.') +1)); | |
if (!/(pdf|zip|doc)$/ig.test(extension)) { | |
alert("Invalid file type: "+extension+". Please use DOC, PDF or Zip."); | |
$("#file").val(""); | |
} | |
} |