title: How to prevent from page refresh on submit button click
body: <p>i have form with one input and one submit button.</p>
  
  <pre><code>&lt;form method='POST' action='' enctype='multipart/form-data' id="form_search"&gt;
  &lt;input type='hidden' name="action" id="form_1" value='1' /&gt;
  &lt;/span&gt;&lt;input id="query" type="text" name="mol" value=""&gt;
  &lt;input type='submit' value='Search' name="Search" id="Search" /&gt;
  </code></pre>
  
  <p>on form submission form input data goes to php below code</p>
  
  <pre><code>if (isset($_POST['Search'])) {
  $_SESSION["query"] = $_POST["mol"];
  $_SESSION["action"] = $_POST["action"];
  }
  </code></pre>
  
  <p>i want to avoid page refresh on form submission. i tried e.preventDefault() and return false; 
  methods in my java script but not working(this methods helping me from page refresh but does not allowing me to send data to php code)</p>
  
  <p>please help me out of this problem, please suggest working ajax code for this problem.</p>