
On 16-05-2014 00:05, Hongliang Wang wrote:
OK. I understand your point and it's good, please go ahead to make it consistent. Though another aspect is that you need remain the consideration for user experience. Maybe there is misunderstanding for my "put cursor" lines. Let me explain it in more details.
Case#1 New user visits Kimchi for the first time There's no cookie set so the user name text box will not be filled by cookie value. So we are to place focus cursor into user name box to provide the convenience that allows user quickly press keys without use mouse to click the cursor into the box first and then start pressing keyboard.
Case#2 User logged out Kimchi and visits Kimchi again later If user allows browser to save cookie, his user name was save into cookie and Kimchi code will load it automatically and fill it into user name box. So it's probably the user will use this same user name and he only wants to input his password. So we place focus cursor into password box.
Case#3 User saved his user name and password In this case, the user only wants to press Enter key or click log-in button to log in. So we focus the log-in button by default to allow user log in by simply entering Enter key.
Hopefully I explained it clearly. Thanks for the clear explanation!
But I think we're talking about different things. I am trying to update the form validation behaviour here (i.e. when the submit will become enabled so it can be clicked, based on the user's input). You are talking about form initialization (i.e. how the form will be in its initial state, taking into account which fields are filled so the correct element is focused). I don't mean to change that now (even though it's a nice topic to discuss for future patches...), your explanation makes sense. What's important to me now is what will happen if the users types something / deletes something after the form is loaded.