jquery form: How to prevent submission.

jquery form: How to prevent submission.

I have a form in a tab.  I use 
            $('#myForm').ajaxForm(function() { 
               alert("Thank you for your comment!"); 
            }); 
and the message appears; however, the form is a file upload

  <form id="myForm" name="upload" class="loginform" action="../php/recordInteraction.php" method="post"
    accept-charset="utf-8"   enctype="multipart/form-data" >
    <input type="hidden" name="rId" value="upload">
    <div>
      <p>
      <input name="file[]" id="file1" type="file"  accept="image/jpeg" required multiple >
       </p>
    <p><label> &nbsp;</label>
        <input type="submit"  name="upload" value="Upload" >
    </p>
    </div>
  <form>

and the file IS uploaded.  How can I stop submission (conditionally)?

Thanks.