0
$('.account-password').on('input', function() {
    console.log(4)
    checkPassword();
});

Why does the above fire on page load? It's right underneath document ready and it's really annoying... This also fires on page load:

.keyup(function() {

There is nothing clicking on that element as it's displayed none?? It also triggers when I press keys on my keyboard, but I am not inside the targetted input field???

Ads
  • 65
  • 6
  • 2
    Please edit the question to include a [mcve]. – evolutionxbox Oct 02 '22 at 13:35
  • It shouldn’t: there is probably other code on your page (which you have not shared) that has this side effect – Terry Oct 02 '22 at 13:37
  • There is literally nothing more to it, it's just a html input which is displayed none. And there is no more JS apart from this inside a document ready – Ads Oct 02 '22 at 13:37
  • @Ads please show this. We cannot replicate what you see from just a description and the current code provided – evolutionxbox Oct 02 '22 at 13:38

1 Answers1

0

The issue was: Even though my form was displayed none. Browser pre-filled the form with saved password which triggered the event. I tried autocomplete="off" on the input but it still triggers. Anyone idea how to prevent browser from filling this in?

Ads
  • 65
  • 6