title: jQuery pressing enter on form to not refresh page?
body: <p>I have a form that currently doesn't refresh the page if I <em>click</em> the button that submits it. But if I press Enter when a text input is focused, it will refresh the page. Is there any way to make it so pressing enter on the text input acts the same as the button so the page doesn't refresh?</p>
  
  <pre><code>function redeemTokens() {
  var code = $("#code").val();
  $.post("_post_redeemtokens.php", { code: code },
     function(data) {
       $('#resultRedeemTokens').fadeIn('slow').html(data);
     });
  }
  
  &lt;form method="post"&gt;
      &lt;input id="code" name="code" type="text" placeholder="Code"&gt;
      &lt;input type="button" onclick="redeemTokens();" value="Redeem" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Thank you for your help in advanced!</p>