[jquery] get the value of input type file , and alert if empty

how to alert if input type file is empty !?

this is my jquery code but i didnt know how to get the value

$('.upload').live("click",function()
{
    var imgVal = $('#uploadImage').val();
    if(imgVal=='')
    {
        alert("empty input file");

    }
    return false;

});


<input type="file" name="image" id="uploadImage" size="30" />
<input type="submit" name="upload"  class="send_upload" value="upload" />

This question is related to jquery

The answer is


<script type="text/javascript">
$(document).ready(function() {
    $('#upload').bind("click",function() 
    { 
        var imgVal = $('#uploadImage').val(); 
        if(imgVal=='') 
        { 
            alert("empty input file"); 

        } 
        return false; 

    }); 
});
</script> 

<input type="file" name="image" id="uploadImage" size="30" /> 
<input type="submit" name="upload" id="upload"  class="send_upload" value="upload" /> 

HTML Code

<input type="file" name="image" id="uploadImage" size="30" />
<input type="submit" name="upload"  class="send_upload" value="upload" />

jQuery Code using bind method

$(document).ready(function() {
    $('#upload').bind("click",function() 
    { if(!$('#uploadImage').val()){
                alert("empty");
                return false;} });  });

There should be

$('.send_upload')

but not $('.upload')