I am trying to create a web page with a login page. When a user logs in for the first time, the username and password will be saved by the browser if it checks "Stay logged in". When it logs in a second time, the browser will autofill the form, and I can enter it without having to interact with the page.
The problem is that I cannot get the password from the login form. Take a look at my code:
$(document).ready(setTimeout(function() { loginForm.form.submit(function(e) {
I clearly see that the username and password are being filled in the form, but for some reason I can’t get the password. Everything goes well. If I manually click the submit button. This, of course, will call checkLogin(); , and I can get the password here. But this will not work if I fire the event manually after the document ready event.
Does anyone know how to fix this, or why is this happening?
Thanks David
EDIT
I just realized that this problem only appears in Chrome for Mac , it works like the charm of Chrome for Windows and Firefox. This does not work in Safari because you need to select the user you want to log in to.
In addition, I also realized that the focus should be set on the web page itself, and not on the URL bar or on the refreshButton button
javascript jquery forms autofill
David Gölzhäuser
source share