title: replacing Enter key code with TAB key code in jQuery
body: <p>I have a script in javascript that replace <kbd>Enter</kbd> with <kbd>TAB</kbd> key:</p>
  
  <pre><code>function ReplaceEnterWithTab() { if (event.keyCode == 13) event.keyCode = 9; return false; }
  </code></pre>
  
  <p>and I use it this way:</p>
  
  <pre><code>txt.Attributes.Add("OnKeyDown", "ReplaceEnterWithTab();");
  </code></pre>
  
  <p>this code work nice.Now I want to develop a script with jQuery that will not need to add <code>OnKeyDown</code> attribute.please consider this sample page:</p>
  
  <pre><code>&lt;form id="form1" runat="server"&gt;
  &lt;div&gt;
      &lt;asp:TextBox ID="TextBox1" runat="server" CssClass="EntTab"&gt;&lt;/asp:TextBox&gt;
      &lt;br /&gt;
      &lt;br /&gt;
      &lt;asp:TextBox ID="TextBox2" runat="server" CssClass="EntTab"&gt;&lt;/asp:TextBox&gt;
      &lt;br /&gt;
      &lt;br /&gt;
      &lt;asp:DropDownList ID="DropDownList1" runat="server" CssClass="EntTab"&gt;
          &lt;asp:ListItem&gt;1&lt;/asp:ListItem&gt;
          &lt;asp:ListItem&gt;2&lt;/asp:ListItem&gt;
      &lt;/asp:DropDownList&gt;
      &lt;asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" /&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I write this code :</p>
  
  <pre><code>$(document).ready(function () {
  
          $('.EntTab').on('keydown', function (e) {
              if (e.keyCode == 13) e.keyCode = 9;
          });
  
      });
  </code></pre>
  
  <p>the problem is when I press <kbd>Enter</kbd> key on <code>TextBox1</code>, <code>Button1</code> cause page post back. How I can solve this issue?</p>
  
  <p>thanks</p>