make enter key act as Tab key on Textbox

farpfrili

New Member
How to make Enter key act as Tab key one text Box in asp.net using jQuery?\[code\]<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title> <script src="http://stackoverflow.com/questions/12595897/Scripts/jquery-1.4.1.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { var inputs = $(':input').keypress(function (e) { if (e.which == 13) { e.preventDefault(); var nextInput = inputs.get(inputs.index(this) + 1); if (nextInput) { nextInput.focus(); } } }); }); </script> </head><body> <form id="form1" runat="server"> <div> <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:TextBox ID="TextBox2" runat="server" TabIndex="3"></asp:TextBox> </div> </form></body></html>\[/code\]
 
Back
Top