0

I have a login mask with a username inputfield, a password inputfield and a submit button. When the password and the username field is empty, I want the button to display the text "Guest access" otherwise "Login".

That works very well but until I save my password in the browser, the username and password fields will be filled but the button still shows "Guest access".

I already saw that instruction but it does not work for my problem:

How to detect when browser places saved password?

When I click into my window or do anything else the button text changes to "Login". But not initally.

I also tried to fire an click or other event, which did not help. I also tried to read the content of the username field with document.getElementById('username').value but its always emtpy, even if I can see the content.

Can anyone please help?

user7521838
  • 370
  • 2
  • 14
  • For security reasons, althought you see the password field filled it is really not filled after user interaction (a click for example). – F.bernal Sep 27 '18 at 14:23
  • So, I will have no chance to know that the browser password and username is used? – user7521838 Sep 27 '18 at 14:25
  • As far as I know, chrome has that behaviour. So in Chrome you cann't know if the password is autocompleted. – F.bernal Sep 27 '18 at 14:27

0 Answers0