我有一個問題,我有一個應用程序,用戶必須盡可能少地使用鼠標,所以他們將只使用鍵盤插入條目。為此,我使用的是模態彈出窗口,每次用戶按輸入時,模態都已準備好進入下一個條目。但為此,第一個模式文本框在每個回車鍵之后聚焦是必要的。我在實現這一點方面遇到了問題...我的代碼:一個按鈕只需調用模態:<asp:Button ID="btnLotIng_Lotear" runat="server" Text="Crear Lotes" class="btn btn-primary btn-block mb-3" OnClick="Crear_Lotes" OnClientClick="focusear()" />面板:<asp:LinkButton ID="lnkFake_LotIng" runat="server"></asp:LinkButton><asp:Panel ID="pnl_LotIng" runat="server" CssClass="modalPopup" Style="display: none;"> <div style="overflow-y: auto; overflow-x: hidden; max-height: 750px; max-width: 1100px"> <div class="modal-body"> <table class="table table-sm table-hover"> <tbody> <tr> <th scope="row">Lote Numero</th> <td colspan="3"> <asp:TextBox ID="txtLogIng_LotNum" runat="server" CssClass="form-control inputfield text-uppercase" Font-Size="Large" Font-Bold="true" onkeydown="LotNKey(event)"></asp:TextBox> </td> </tr> <tr> <th scope="row">Id1Desde</th> <td> <asp:TextBox ID="txtLogIng_Id1Des" runat="server" CssClass="form-control inputfield text-uppercase" Font-Size="Small" onkeydown="id1DKey(event)"></asp:TextBox> </td> <th scope="row">Id1Hasta</th> <td> <asp:TextBox ID="txtLogIng_Id1Has" runat="server" CssClass="form-control inputfield text-uppercase" Font-Size="Small" onkeydown="id1HKey(event)"></asp:TextBox> </td> </tr> <!-- here go other rows with textboxes --> </tbody>
ASP,在 Enter 之后聚焦文本框
aluckdog
2022-08-18 15:58:28