Help with jquery validation fileupload

Help with jquery validation fileupload

Hi all Masters,

I have a FileUpload function in asp.net.
Below is my asp.net button.
  1. <asp:FileUpload id="FileUpload1" runat="server" Width="150px"/>
  2. <asp:Button id="btnUpload" runat="server" Text="Upload" onclick="btnUpload_Click" />
Which I can upload successful.

I try with asp validator but no luck.

  1. <asp:RequiredFieldValidator ID="RequiredFieldValidator1"
  2.     runat="server" ErrorMessage="Please upload your receipt." 
  3.     ControlToValidate="FileUpload1" CssClass="alerttext"></asp:RequiredFieldValidator>

I need to validate whether if it's empty. If it's empty then alert user.
I have a img type button. The code are below.
  1. <img name="Submit" type="image" onMouseOver="this.src='images/B_F_H.gif'" onMouseOut="this.src='images/B_F_L.gif'" onClick="validateField();" src="images/B_F_L.gif" width="105" height="32"/>
What I want to do is when clicked on this I need to validate the fileupload is not empty.
Below code I tried but no respond.
  1. <script type="text/javascript">
  2. function validateField()
  3.     { 
  4.         var imgVal = $('#FileUpload1').val(); 
  5.         if(imgVal=='') 
  6.        { 
  7.             alert("empty input file"); 

  8.         } 
  9.         return false; 

  10. }; 
  11. </script>