[英]Use Enter to Submit twice on the same page
I'm adding a extra functionality to an existing program. 我在现有程序中添加了额外的功能。 Its a Login page to manage the time a user came in and out. 它的“登录”页面可管理用户进出的时间。 So first a login is asked, then (on the same page) a list with the login times are shown. 因此,首先要求登录,然后(在同一页面上)显示带有登录时间的列表。 The same button is used (just relabelled) for the login and time in/out. 登录和超时输入/退出使用相同的按钮(重新标记)。
The problem exist when users want to use enter to login and time in/out. 当用户要使用Enter进行登录和超时时,存在该问题。 So quickly press enter twice. 因此,请快速按两次Enter键。 No problems with the login. 登录没有问题。 But the second page wont recognize the enter. 但是第二页将无法识别回车。 even when I capture the keypress with JavaScript nothing happens. 即使使用JavaScript捕获按键,也不会发生任何事情。 I have to click the form (or a object in the form) so the enter would work. 我必须单击表单(或表单中的对象),这样输入才可以工作。
Tried UseSubmitBehavior, Javascript, changing focus. 尝试使用UseSubmitBehavior,Javascript,更改焦点。
I'm actually desperate and thinking of rewriting the whole thing. 我实际上很拼命,想重写整个事情。
Based in your description of this problem, I suggest two different options: 根据您对此问题的描述,我建议两个不同的选择:
Hope this helps. 希望这可以帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.