Jquery: React To Form Auto-filling By Browser
I have two form elements, a email and a password. The password element must only be shown if something has been entered in the email element. That is, only if email is not empty. &
Solution 1:
Browser auto-filling occurs on initial page rendering. Have you tried checking the field in an "onReady" callback? Note that this event is only provided by higher level implementations like Jquery, not directly by the browser.
Example of "ready" callback with jquery: (updated to reflect the comments)
$(function() {
setTimeout(function() {
$("#email").trigger('change');
}, 200);
});
There is also an article explaining the "do it yourself way": http://dustindiaz.com/smallest-domready-ever
Solution 2:
You may try disabling the browser autocomplete feaure by;
<formaction="demo_form.asp"method="get"autocomplete="off">
or
<INPUTNAME="name"SIZE=40AUTOCOMPLETE=OFF>
Note. The first one is HTML5 <form>
autocomplete Attribute
Post a Comment for "Jquery: React To Form Auto-filling By Browser"