Enabling browser's form auto-filling
The problem was that the form tag didn't have method="POST"
on it.
After Googling the message, I found a bug report, and one of the comments mentioned method="POST"
.
I added method="POST"
, and voila! Auto-fill works.
In some cases you may also need to add an action
if the form doesn't have one. action="javascript:void(0)"
works.
Note: Auto-fill seems to trigger the onchange
event.
Note 2: As for how the browser knows what field is what, see this question: How to trigger Autofill in Google Chrome?
The option to turn off autcomplete is normally located in the form tag, see the Developer page from Mozilla here. This should mean that normally removing that attribute should enable it again on a webpage.
Concerning the second part with the AJAX request, I don't think there's a listener for that, but you could add a function that checks the value of the field each x seconds for example, and if it changed you can perform your lookup.