It’s not uncommon user needs to login. And in most browsers, there is a password manager. The problem is that for forms, that are built using javascript, browser doesn’t recognize forms. And autofill feature doesn’t work.
The browser seems to identify the fields by it’s name attribute. I have had the same problem and sorta solved it by adding an arbitrary “name” attribute to my input fields.
The name tag might not be enough (even though it is required). To have the Chrome autocomplete fully working on my payment page (credit card and address auto completion) I had to wrap my fields around a <form> tag at the top of the handlebar template. The form tag must have the following attributes:
<form autocomplete="on" method="POST">
If you also wanna have your form being submitted when the user hits the enter key, you must use a submit button and move your action attribute in the form itself. This way:
I am having the same issue. This is an issue with the mechanism how AJAX submits a form request, and I think there is no a good solution for all browsers. See
I noticed that the Firefox(on Ubuntu) browser works fine as long as you have a constant id or name set for the input field like this:
Basically, we can use a hidden iframe in the same page, set the action of your form to the ‘src’ of the iframe, and add a hidden submit button inside the form, when user clicks your button which triggers AJAX requests, you should programmatically click the hidden button before sending the AJAX request. see example below:
$('#go_button').click(function(event){
//submit the form to the hidden iframe
$('#submit_button').click();
//do your business here
$.ajax(function(){
//whatever you want here
}})
);
In my application, many pages need auto-complete, so I made a convenient function below: