do not refresh page upon form submit
<p>I am trying to submit this form without refreshing the page. I'm using jquery; upon submit the page still refreshes.</p>

<pre><code>$(function(){
  $('#submit').click(function(){
    $('#container').append('loading');
      var sthis = $('#sthis').val();
      $.ajax({
         url: 'f.php' , 
         type: 'POST',
         data: 'sthis: ' + sthis,
         success: function(result){     
           $('#container').append('&lt;p&gt;' +     result + '&lt;/p&gt;')      
         }
      });   
      return false;     
   });
});
</code></pre>

<p>html page (f.php)</p>

<pre><code>&lt;div id="container"&gt;
&lt;form method="post" action="f.php"&gt;
something&lt;input name="sthis" type="text" /&gt;
&lt;input type="submit" value="submit" id="#submit" /&gt;
&lt;/form&gt;
&lt;/div&gt;
</code></pre>

<p>php page</p>

<pre><code>&lt;?php

if(isset($_POST['sthis'])){
  $sthis = $_POST['sthis'];
  if(empty($sthis)) { echo 'put something in this box'; }
  else echo 'ready';
}

?&gt;
</code></pre>
