<script>function Checkfiles()
{
var fup = document.getElementById('profile_img');
var fileName = fup.value;
var ext = fileName.substring(fileName.lastIndexOf('.') + 1);
if(ext == "gif" || ext == "GIF" || ext == "JPEG" || ext == "jpeg" || ext == "jpg" || ext == "JPG" || ext == "doc")
{
return true;
}
else
{
document.getElementById("err_profile_img").innerHTML="Upload a valid image";
return false;
}
}</script><input type="file" name="profile_img" id="profile_img" onchange="Checkfiles()"/>
No comments:
Post a Comment