<script src="../gisjs/jquery-123.js" type="text/javascript" language="javascript"></script>
<script type="text/javascript" language="javascript"> function show(obj) { if(form1.elements[form1.elements.length-1]!=obj) { for(var i=0;i<form1.elements.length;i++) { if(form1.elements[i]==obj) { for(var j=i+1;j<form1.elements.length;j++) { if(form1.elements[i].type!="hidden") { form1.elements[j].focus(); return ; } } return ; } } } } function updown(obj) { if(form1.elements[form1.elements.length-1]!=obj) { for(var i=form1.elements.length-1;i>=0;i--) { if(form1.elements[i]==obj) { for(var j=i-1;j<form1.elements.length;j--) { if(form1.elements[i].type!="hidden") { form1.elements[j].focus(); return ; } } return ; } } } } // document.οnkeydοwn=function(obj) // { // var oEvent=window.event; // if( if(oEvent.keyCode==38) { } if(oEvent.ctrlKey) { if(oEvent.keyCode==13) { document.getElementById("Button1").focus(); document.getElementById("Button1").click(); } } // } </script>
</head> <body> <form id="form1" runat="server"> <div> <asp:TextBox ID="TextBox1" runat="server" MaxLength="5"></asp:TextBox> <br /> <asp:TextBox ID="TextBox2" runat="server" MaxLength="5"></asp:TextBox> <br /> <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox> <br /> <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox> <br /> <asp:TextBox ID="TextBox5" runat="server"></asp:TextBox> <br /> <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" OnClientClick="return d();" /></div>
<script type="text/javascript" language="javascript"> $("input").css("maxlength","5"); $("input").keydown(function() { oEvent=window.event; if(oEvent.keyCode==38) { updown(this); } if(oEvent.keyCode==40) {show(this); } }); </script>