posted 15 years ago
function uploadForm()
{
document.forms[0].cmpLogo.value = document.forms[0].companyLogo.value;
if (fileTypeCheck() == false)
{
return false;
}
document.forms[0].compLogo.src = document.forms[0].companyLogo.value;
}
function fileTypeCheck()
{
var reOkFiles=/\.(jpg|JPG|jpeg|JPEG|gif|GIF)$/i;
if(document.forms[0].companyLogo.value != "")
{
var fileStr =document.forms[0].companyLogo.value;
if(!reOkFiles.test(fileStr))
{
alert("Please upload only jpg, jpeg or gif file formates");
return false;
}
}
}