form submitting with jquery

form submitting with jquery

Hello,


I have a problem with a file upload form , i dont know why, but the form dont want to be submitted


 
<script>
$('#submitFormUpload').click(function()
{
    alert("click form2");
 
          
      $('#FormUpload').submit();
      $('#upload_wait').html ( '<img src="images/ajax-loader2.gif" alt="" />' );

}

</script>


<form action="ajax/upload-media.php" target="frame_upload_target" name="FormUpload" id="FormUpload" enctype="multipart/form-data" method="post" style="display:inline;">
            
      <input name="upload" type="file" id="upload" size="50" />
      
       <iframe src="about:blank" width="5" height="1" id="frame_upload_target" name="frame_upload_target" frameborder="0" ></iframe>
   <div id="upload_wait"></div>
   

<div id="submitbtn"> <a href="javascript:;" id="submitFormUpload"><img src="images/submit1.gif" alt="Submit" name="submit" width="76" height="26" border="0" id="submit" ></a> <div id="submitWait2"></div></div>
 </form>


 



I can see the alert and the ajax uploader when i click on the submit link, but nothing happen after, i dont get any javascript errors , and firebug dont display any call for "ajax/upload-media.php"

am I missing something ?

i also tryed with





$.ajax({
                        url: 'ajax/upload-media.php',
                        data: $('#FormUpload').serialize(),
                        type: 'post',
                        success: function (j) {
             
             
                alert(j);
              } 
       });


 

 




but $_FILES on server side remains empty