I am dynamically generating a form. For simplicity's sake assume it's a login form with email/password. The form is submitted, but onsubmit it fires an AJAX request that handles the actual login and the submit event is cancelled (e.preventDefault()
).
I use e.preventDefault()
to cancel the default action of the form, that is, go to the page in 'action' but this also seems to cancel the autocomplete detection of the browser.
I think you need to fullfill several requirements for the native autocomplete to work:
- Your input field
type="text"
must have aname
- The form must be submitted <-- this isn't really happening in my case
Is my analysis correct and is there any way to make autocomplete work in this case?
To ward off the fanboys: I'm not looking for any solution that involves jQuery or [insert your framework], I want to use the native browser autocomplete feature. I don't have a list of words that I want to autocomplete with.