-
22 Feb 2009 12:54 PM #1
Remember password in browser
Remember password in browser
I have a login form.
I want the browsers to remember login and password for this form.
Normally FireFox and Opera offer to remember password, but not for this ExtJS form.
How to allow browsers to remember password?
I searched a lot through the forum, but did not find an answer.Code:new Ext.FormPanel({ id: 'formLogin', url: '/login', defaultType: 'textfield', items: [{ fieldLabel: 'Username', name: 'user' },{ fieldLabel: 'Password', name: 'password', inputType: 'password' }], buttons:[{ text: 'Login', handler: function() { login.getForm().submit(); } }] });
-
22 Feb 2009 1:00 PM #2
You should use a cookie

So basically if someone click "remember me" checkbox in your login form, you can create a cookie and store in it username and password; next time your user is going to open that very page, you should check the existence of the cookie while loading your page and in case it exists, you can use it to read username and password from the cookie and use it to fill the form fields (no magic
).
Maybe you can have a look at the StateManager in Ext that use the same mechanism
Hope this helps
-
22 Feb 2009 5:22 PM #3
Have a look at this thread: http://www.sencha.com/forum/showthread.php?t=6450 It's kinda old but what was said there is still valid.
The browser only auto-fills login-forms if they are present at page load.Daniel Jagszent
dɐɳiel@ʝɐgszeɳt.de <- convert to plain ASCII to get my email address
-
23 Feb 2009 6:43 AM #4
Thank you people.
Cookie is an obvious solution of course, but I did not want to use it, since all modern browser have mechanism to remember form fields.
But it looks like I should use cookies, since, as it was said in that discussion
"it's not possible to have a JavaScript injected form and password auto-completion at the same time"



Reply With Quote