Text changed vs. click event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm writing a small ASP.NET app (written in VB.NET). It starts off with a Login screen

It contains a drop-down box for the username, a textbox for the password and a link button for the sign on

I want to allow the following scenarios
1) Allow the user to press 'enter' on their keyboard after entering the passwor
2) Tab to the 'SignOn' button and press enter
3) Click the button with their mouse

All three should check the validity of the password, if correct redirect to next page, if incorrect, state error message

I am having trouble with the DB access on number 2 & 3 because I have both a PasswordText_Changed event and a Button_Click event. When 2 & 3 are done, both events fire, starting with the passwordtext_changed event. I can fix it by only having a passwordtext_changed event but if I have a button shouldn't I have a click event. But if I only have a click event, number 1 doesn’t fire off an event.

I am new at ASP.NET programming, is there a better solution or am I missing something. These three scenarios seem to be things I am able to do on most public websites as a user

Any input would be appreciated
Thank-you
Barbara Alderto
 
Barbara,

It is not only what is technical possible in a program (this is something
many programmers forget) but also what behaviour your user expect.

In this case, he/she sees a button to submit, let that button work.

Consistency is very important for a user.

Just my thought about this,

Cor
 
Thank-you for your thoughts

Maybe its just habit but many websites work this way and I have come to expect it as a user

However, even when trying to just have a click event and let the button work I would still want certain results if the user were to hit enter. Currently if the user hits enter after typing in a password even if he didn't mean to I would want it to do nothing, forcing the user to either tab to the button or click the button. But instead it erases the password and starts over. I have even tried to add a txtpassword_changed event that just changes the focus either to the button or the text box, but it still clears the textbox. How can I get it to do nothing if the user accidentally hits the enter key on their keyboard

Barbar
 
Hi Barbera,

I agree with you that I find it also terrible behaviour of webpages.

And this is not consistent, you can when you push Enter one time send, the
other time it cleans and sometimes it does nothing, maybe I find something
for you, but I do not promish it at all.
(And not today anymore).

Cor
 
Back
Top