0

I have a problem with autofill feauture of my browser. Once a user logins with her email and password, browser holds these two information for future reference. When she opens login page, email and password fields are populated by browser. Event which I binded using jquery for email triggered. On the other hand event for password isn't triggered.

Login form contains following lines:

<form method="post" action="/login" id="login-form">
    <input type="email" placeholder="Email" id="email" name="email"/>
    <input type="password"  placeholder="Password" id="password"  name="password"/>
    <button type="submit" />
</form>

My script file:

<script type="text/javascript">

$(document).ready(function () {    

$("#email").on('change keyup paste mouseup',function () {
    alert("email");
});    
$("#password").on('change keyup paste mouseup',function () {
    alert("password");
});

});

</script>

These two fields are populated by browser successfully. But only "email" messages is shown. Event which is for password isn't triggered.

Any suggestions ?

Thanks.

Hilmi Yamcı
  • 463
  • 8
  • 20
  • You didn't close your `.ready(` or either `.on(` so you're missing three `)` parens. Granted, I'd expect that to throw from the beginning - because you said that "the email message is shown", this leads me to believe it was just a typo in your question. – Tyler Roper Jun 20 '17 at 18:38
  • Use console.log instead of alert – Musa Jun 20 '17 at 18:45
  • @Santi I did't missed them in my login page. Just forgot to post here. I edited the code – Hilmi Yamcı Jun 20 '17 at 18:47
  • @Musa, I have used console.log. It prints email but not password – Hilmi Yamcı Jun 20 '17 at 18:48
  • I think this is a bug as discussed in this post: https://stackoverflow.com/questions/35049555/chrome-autofill-autocomplete-no-value-for-password – Hilmi Yamcı Jun 20 '17 at 19:18

0 Answers0