<script language="javascript" type="text/javascript">
/*To check file extensions */
function checkFileExtension( s,e ){
parafilevalue =document.getElementById("FileUpload1").value
var file = parafilevalue.split('.');
var validType = false;
if( file.length < 2 )
{
return false;
}
var fileext = file[1].toLowerCase();
if( fileext == 'doc' || fileext == 'pdf'|| fileext == 'xls' || fileext == 'ppt'|| fileext == 'txt' )
{
validType = true;
}
if(validType==false)
{
alert("Please enter specified document type");
var who= document.getElementsByName('FileUpload1')[0];
var who2= who.cloneNode(false);
who2.onchange = who.onchange;
who.parentNode.replaceChild(who2,who);
}
return validType;
}
< /script >
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment