repeater中按回车从一个textbox跳到下一个textbox?
<ItemTemplate>
<tr>
<td width="150" align="center" >
<asp:TextBox ID="TextBox1" runat="server" style="text-align:center" width="60" BorderColor="#FFFFCC" Height="15" onkeypress="if ((event.keyCode<48 || event.keyCode>57) && event.keyCode!=46) event.returnValue=false;" >
</asp:TextBox></td></tr></ItemTemplate>
[解决办法]
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$(":input").keydown(function (e) {
if (e.keyCode == "13") {
$(this).next().focus();
}
});
})
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="Text1" type="text" />
<input id="Text2" type="text" />
<input id="Text3" type="text" />
<input id="Text4" type="text" />
<input id="Text5" type="text" />
<input id="Text6" type="text" />
<input id="Text7" type="text" />
<input id="Text8" type="text" />
<input id="Text9" type="text" />
</div>
</form>
</body>
</html>
<script type="text/javascript">
$(document).ready(function () {
$("input[type=text]").keydown(function (e) {
if (e.keyCode == "13") {
$(this).parent().parent().next().children().first().children().first().focus();
}
});
})
</script>