0

I have an interesting issue reagarding to browser autofill functionality. On my web app there is a login page with 2 inputs username and password. I save my password and username via browser. If I try to login again browser autofills the credentials. It is OK but my login button is "greyed out" until user do not changes the inputs or clicks into the form. I want to achieve that after autofill button is enabled.

  1. I tried autocomplete="off|false|..." property it does not work -> here I wanted to prevent autofill
  2. My second idea was to check inputs after page load in some intervals. So I used setInterval() hovever after browser autofilled the password input I'm not able to get value of it. To be more exact I for call $('#login-password').val() I get empty string hovever it is filled in.

Did someone meet that kind of behaviour? So it would be also acceptable solution to prevent autofill by browse but as I mentioned autocomplete property did not work. I'm testing on Chrome Version 47.0.2526.106 m

Kingmaker
  • 469
  • 1
  • 6
  • 20
  • can you provide a example of the code? – ppollono Jan 08 '16 at 16:28
  • What causes the button to be disabled in the first place? How do you normally enable it? – David Jan 08 '16 at 16:29
  • try providing a fiddle man, – Siddharth Jan 08 '16 at 16:42
  • I cant provide fiddle because I did not know how to "force" browser to save my credentials and after that autofill it after refresh. Hovewer I can add some codesnippet into my question. – Kingmaker Jan 08 '16 at 20:26
  • @David The use case looks like this: user loads the page he has to provide credentials. If username and password fields are empty then login button is disabled. If username and password are provided by user then I enable the button and user can login. – Kingmaker Jan 08 '16 at 20:29
  • @thadam: Well, the use case description doesn't *actually* cause the button to be disabled or enabled. Presumably there's some code involved to make that happen? If the button is being disabled when it shouldn't, or failing to be enabled when it should, then we'd of course want to examine the code which performs these actions. – David Jan 08 '16 at 20:43
  • @David: Yes for sure there is a code involved in which enables or disables button. :) But what I have currently implemented it is working fine. I just can not deal with autofill functionality of browser. I can not catch it via event or something else and enable the login button....I'm listening on keyup, focus, blur, change events on input but any of them is triggered during autofill by browser. – Kingmaker Jan 08 '16 at 21:09
  • Possible duplicate of [Detecting Browser Autofill](http://stackoverflow.com/questions/11708092/detecting-browser-autofill) – Alvaro Montoro Jan 11 '16 at 05:38

0 Answers0