Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FireFox capture autocomplete input change event

I'm trying to subscribe to change events on an input tag for an ajax auto complete form. These change events are not firing when the user clicks an autocomplete suggestion from FireFox.

I've seen fixes for IE, but not FireFox. You can view this behavior here

Steps to recreate: type any input in one of the boxes and click submit.

Start typing the value again in the same box.

You should see the autocomplete suggestion box appear below the input box. Notice that clicking the suggestion does not fire the change event (it also doesn't fire the click event)

Currently my only option is to disable autocomplete on this field, but I do not want to do that.

like image 247
KClough Avatar asked May 14 '09 20:05

KClough


People also ask

Does Firefox have autocomplete?

URL autocomplete In addition to the autocomplete drop-down list, Firefox will also complete the URL in the address bar.

Why does autofill not work in Firefox?

Check Firefox settings Select the Privacy & Security panel and go to the History section. In the drop-down menu next to Firefox will choose Use custom settings for history. Make sure that Remember search and form history is selected. Enabling form autocomplete also makes Firefox store search history for the Search bar.


2 Answers

Firefox 4+ fire 'oninput' event when autocomplete is used.
Here's some jQuery to make this more actionable:

$('#password').bind('input', function(){ /* your code */});
like image 56
Jethro Larson Avatar answered Oct 18 '22 17:10

Jethro Larson


I've had the same problem.

Apparently, there is password manager debugging available https://wiki.mozilla.org/Firefox:Password_Manager_Debugging

So I've found that for me DOMAutoComplete event got triggered and I've managed to attach it sucessfuly to a field via jQuery's bind like

$('#email').bind('DOMAutoComplete',function() { ...
like image 28
Aleksandar Pavić Avatar answered Oct 18 '22 16:10

Aleksandar Pavić