I am triggering a file upload on href click. I am trying to block all extension except doc, docx and pdf. I am not getting the correct alert value.
&
var file = form.getForm().findField("file").getValue(); var fileLen = file.length; var lastValue = file.substring(fileLen - 3, fileLen); if (lastValue == 'doc') {//check same for other file format}