function addFileInput() { var fileName = document.getElementById("uploadFile").value; //alert("hi:"+fileName); self.parent.displaySmallDocs.location.href="display_small_documents_GUI.asp?retrieve=yes&count=yes&doctype="+sDocType+"&filelist=" + fileName; } function CheckFileName() { var fileName = document.getElementById("uploadFile").value if (fileName.split(".")[1].toUpperCase() == "TIF"){ addFileInput(); } // return true; else { alert("File with " + file.fileName.split(".")[1] + " is invalid. Upload a valid file with tif extensions"); return false; } return true; }
<style type="text/css"> #container { position: relative; width: 4.00em; height: 2.50em; overflow: hidden; background-image: url("../images/icons/search2.gif"); background-repeat: no-repeat; } #Search, #uploadFile { position: absolute; cursor: default; } #Search { top: 0; left: 0; border: 1px solid #000; } #uploadFile { opacity: 0.001; font-size: 300%; top: -5px; right: -5px; } </style> <!--[if IE]> <style type="text/css"> #uploadFile { filter:alpha(opacity=0.1); } </style> <![endif]--> <td> <div id="container" title="Choose File"> <input id="uploadFile" type="file" multiple name='files[]' onchange="CheckFileName()" > <script language="javascript"> displayIcon("SearchButton","../images/icons/search2.gif","javascript:CheckFileName();","<%=Lan("SEARCH")%>"); </script>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)