I am trying to submit a form(which also contains a fileinput) using ajax , everything works fine but I can't prevent default form submission using return false and e.preventdefault() method.

This is my jquery ajax submission code :

```
var formrequest = $('#Request_Search');

formrequest.submit(function (e)     
    {       
         alert("form submit called");
        var fileInput = $('#file'); 
        var file = fileInput.files[0];
        var data = new FormData();
        data = formrequest.serialize();
        data.append('file', file);
       $.ajax({
          type: formrequest.attr('method'),
          url: formrequest.attr('action'),
          data: data,
          contentType: false,
          processData: false,
          success: function (data) 
          {
            alert("Reached")
          },
            error:function()
            {
                 alert("failure");

             }   
        });        
       return false;     //I have tried e.preventDefault() also.But that also does't help   
    });

```

Code for my form :

```
<form id="Request_Search" method="post" action="queryupload" enctype="multipart/form-data" class="col-md-12" style="margin-top: 20px;">

<div class="form-group" id="filediv">

        <label for="file">Upload your Fasta File:</label>
        <input type="file" class="form-control"  name="file" id="file"   required accept=".txs,.fasta,.fa">    
</div>

  <div class="form-group">
   <label for="file">Enter you email id:</label>
    <input type="email" class="form-control" name="emailid" id="emailid" placeholder="Enter emailid so we can send you outputs" required>
</div>

<div class="form-group">
 <label for="file">Enter Percent Identity value :</label>
    <input type="number" min="0" max="100" class="form-control" name="pident" id="pident" placeholder="Enter value for pident" required>
</div>

<div class="form-group">
    <label for="file">Enter Mismatch percentage :</label>
    <input type="number" min="0" max="100"  class="form-control" name="mismatch" id="mismatch" placeholder="Enter values for % mismatch expected" required>
</div>

<div class="form-group">
<label for="file">Enter query coverage :</label>
    <input type="number" min="0" max="100" class="form-control" name="querycoverage" id="mismatch" placeholder="Enter values for query coverage" required>
</div>

<br/>

<div class="form-group"> 
    <input type="submit" value="Submit" i class="btn btn-primary btn-lg btn-block"></input>     
</div>

 </form>

```

In servlet's dopost() method :

```
protected void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException
     {
     PrintWriter po = response.getWriter();
     po.write("Check text");
     }

```

From google Chrome devloper tools.If it can help in anyway:

![enter image description here](https://i.stack.imgur.com/B2mor.png)
My servlet is being called properly , but I am redirected to next page and result on that page.how to prevent this?