I want alert if no file is selected. But in this code When a file is selected. It Still show The alert. Please Tell me how to fix it.
<script>
function null_upload()
{
var a = document.getElementsByName("upload_file").value;
if(a == null)
{
alert('Please Select Min 1 File.');
return false;
}
}
</script>
Upload Form is
<input type="file" name="upload_file">
<input type="image" src="img/upload.png" id="upload_botton" title="Upload Image" name="submit" onclick="return null_upload()"/>