I have a form that allows for multiple file uploads.
<input name="uploadedfile[]" type="file" multiple="true"/>
Now, I want to validate it using javascript to check if a file was selected. I tried the following but failed
if(form.uploadedfile.length < 1)
{
alert("You Forgot to select an image");
return false;
}
and I know its an array but i also tried
if(form.uploadedfile.value == '')
{
alert("You Forgot to select an image");
return false;
}
can someone help me out on this one. Thanks