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?