Let's say I have an HTML form to allow a user to sign in to a web site. The form is not statically visible, but shown on-demand via a Bootstrap Popover.
This works as intended except for one tiny detail: The browser's password manager does not offer auto-completion of credentials in this form (most probably because it is not visible at the time the page is initially rendered).
Adding autocomplete="on" to the form and the input elements did not change anything.
Is there any way to trigger the form completion again after the login form has become visible?
The form looks like this:
<div id="login_popover_content">
<form accept-charset="UTF-8" action="/users/sign_in" autocomplete="on" class="form-horizontal" id="new_user_popover" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓"><input name="authenticity_token" type="hidden" value="..."></div>
<fieldset>
<div class="control-group">
<label class="control-label" for="user_login">User</label>
<div class="controls">
<input autocomplete="on" class="input-medium" id="user_login" name="user[login]" size="30" type="text">
</div>
</div>
<div class="control-group">
<label class="control-label" for="user_password">Password</label>
<div class="controls">
<input class="input-medium" id="user_password" name="user[password]" size="30" type="password">
<span class="help-block"><a href="/users/password/new">Forgot your password?</a></span>
</div>
</div>
<div class="control-group">
<div class="controls pull-right">
<input class="btn btn-warning pull-right" name="commit" type="submit" value="Login">
</div>
</div>
</fieldset>
</form>
</div>
The popover is shown using:
$(anchor).popover(
content: $(content).html()
placement: 'bottom'
html: true
trigger: 'click'
template: '<div class="popover headless"><div class="arrow"></div><div class="popover-inner"><div class="popover-content"><p></p></div></div></div>'
)