Hi,
Find your solution below.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TextBoxEnterbox.aspx.cs" Inherits="TextBoxEnterbox" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<title></title>
<script type="text/javascript">
$(document).ready(function() {
$('input:text:first').focus();
$('input:text').bind('keydown', function(e) {
if (e.keyCode == 13) {
e.preventDefault();
var nextIndex = $('input:text').index(this) + 1;
var maxIndex = $('input:text').length;
if (nextIndex < maxIndex) {
$('input:text:eq(' + nextIndex+')').focus();
}
}
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
First Name: <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
Last Name: <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
Email: <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
Confirm Email: <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
<asp:Button ID="btnSubmit" runat="server" Text="Submit" />
</div>
</form>
</body>
</html>