I have created a form that must pass validation via JQuery to see if the fields are not null. In my form, I have <input type="file" id="file"></input>
. When I run the following code, it doesn't work. Can someone shed some light on this for me? Thanks!
$('#check').click(function(){
$('#submit').hide(200);
var fileVal = $('#file').val();
if(fileVal=='')
{
alert("Empty input file");
}
});
For those who want more, by "work" I mean that I do not get the alert specified when the "check" button is clicked.
EDIT: I spelled something else wrong in my code. >.< I was staring at the screen for 2 hours, so I came here, but thanks anyway.