views:

57

answers:

1

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. So quickly press enter twice. No problems with the login. But the second page wont recognize the enter. even when I capture the keypress with JavaScript nothing happens. I have to click the form (or a object in the form) so the enter would work.

Tried UseSubmitBehavior, Javascript, changing focus.

I'm actually desperate and thinking of rewriting the whole thing.

+1  A: 

Based in your description of this problem, I suggest two different options:

  1. You can add both the login and the time in code under the same event. For example, when the user enters their login information and hits enter you can call the method to login the user and if successful then call the time-in method right after that - this should happen when the user hits enter, no need to do it twice.
  2. Create another button. One for the login and one for the time-in/out. After a user logs in, hide the login button and display the time-in/out button.

Hope this helps.

Ricardo