iPhone autofill passwords - html

I can't get my iPhone to remember my username and password for the login to my website. The controls I currently have are:
<input type="text" name="username" id="username" />
<input type="password" name="password" id="password" />
<select>
<option value="1">option1</option>
<option value="2">option2</option>
</select
<input type="checkbox" name="rememberMe" id="rememberMe" />
<input type="button" value="Login" />
When the select is removed, it all works magically. Is there a way to declare / give safari extra hints that this is a logon page?

I've tested with my iPhone and some test page with the following content makes the iPhone ask whether it should save the password and remember it the next time I visit the page.
x.html
<form action="x.html" method="POST">
<input type="text" name="username" id="username" />
<input type="password" name="password" id="password" />
<select>
<option value="1">option1</option>
<option value="2">option2</option>
</select>
<input type="checkbox" name="rememberMe" id="rememberMe" />
<input type="submit" value="Login" />
</form>
So basically it's the same as yours except that the button is of type "submit" instead of "button" and that there are form tags around the whole code snippet.

You might also want to look at the new iOS 8 feature to share passwords between Safari and apps:
https://developer.apple.com/library/ios/documentation/Security/Reference/SharedWebCredentialsRef/
http://www.raywenderlich.com/90978/secure-passwords-with-safari-autofill-ios-8

I'm not sure if that's your actual HTML or what that is, but if that's the html I can see why it wouldn't work. First thing you probably want to add are closing tags.
<input type="text"></input>
<input type="password"></input>
<select></select>
<input type="checkbox"></input>
<input type="button"></input>

Another thing you can try is to to add an ID and/or a name to the <select> tag.

Related

Browser save password show in wrong input

This is login form
<form method="post">
<input name="username" type="text" />
<input name="password" type="password" />
</form>
After login and save password by Browser, i go to users manage page
<form method="post">
<input name="email" type="text" />
<input name="name" type="text" />
<input name="password" type="password" />
</form>
This page, browser show password and username by default to name and password
How fix it ?
https://i.stack.imgur.com/uniJY.jpg
https://i.stack.imgur.com/7ZbTJ.jpg
Use different names in input tag
How do you disable browser Autocomplete on web form field / input tag?
Used autocomplete attribute of tag.
read this link:https://www.w3schools.com/tags/att_form_autocomplete.asp
Autocomplete. autocomplete="off|on".
"When autocomplete is on, the browser automatically complete values based on values that the user has entered before." link
<form method="post" autocomplete="on">
<input name="email" type="text" />
<input name="name" type="text" />
<input name="psw" type="password" />
</form>
You shouls also use different input names.

autocomplete="off" not working none of browser

Here is the code :
<form method="post" action="default.aspx" id="form1" autocomplete="off">
<div class="loginContnet">
<input " name="SC_Login1$txtUserCode" type="text" id="SC_Login1_txtUserCode" class="txtUserCode" autocomplete="off">
<input name="SC_Login1$txtPassword" type="password" id="SC_Login1_txtPassword" class="txtPassword" autocomplete="off">
<input type="submit" name="SC_Login1$btnOK" value="OK" id="SC_Login1_btnOK" class="btnOK">
</div>
</form>
Why all browsers except Mozilla ask save password and how to prevent that?
Indeed, browsers do not give a shit about autocomplete="off" attribute for password saving / restoration.
I did encounter the same problem recently and solved it with a nice shiny and beautiful hack as you can see below. The trick consists in having two fields corresponding to login and password with display: none;, hence the browser believe it is the actual login and password fields! Haha, stupid browser!
<form>
<input type="text" id="email" name="email" size="40" autocomplete="off" />
<input type="text" style="display: none;" name="loginForAutoCompleteDisable" />
<input type="password" style="display: none;" name="passwordForAutoCompleteDisable" />
<input type="password" id="password" name="password" autocomplete="off" />
</form>
Hope this helped!
autocomplete=off only tells the browser not to show suggestions based on your browsing history.
It has nothing to do with save-password
as far as I know, the autocomplete-attribute is used for showing suggestions based on your prior entered values. it has nothing to do with the "save-password"-question. I dont think you can disable the "save-password"-question by html, because it's up to every single client.
The only problem using this attribute is that it is not standard
(it works in IE and Mozilla browsers).
Answer to this question
<form method="post" action="default.aspx" id="form1" autocomplete="off">
<div class="loginContnet">
<input name="SC_Login1$txtUserCode" type="text" id="SC_Login1_txtUserCode" class="txtUserCode" autocomplete="off">
<input name="SC_Login1$txtPassword" type="password" id="SC_Login1_txtPassword" class="txtPassword" autocomplete="off">
<input type="submit" name="SC_Login1$btnOK" value="OK" id="SC_Login1_btnOK" class="btnOK">
</div>
</form>

Safari Autofill: Trigger password suggestions in Devise registration form

I have a very standard Rails 4 Application using Devise 3
I want to have the registration form to trigger password suggestions in the current (Mavericks) version of Safari:
iCloud Keychain is enabled and I get suggestions on other pages, just my form does not work with that for some reason.
I can't seem to figure out what exactly it takes to enable suggestions.
Here is the form that devise generates:
<form accept-charset="UTF-8" action="/users" class="new_user" id="new_user" method="post">
<div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" />
<input name="authenticity_token" type="hidden" value="SKtqmi1L/BKcTE/Hvlvw1H3ZRH8nd2UNiNnVILuLS/E=" />
</div>
<div>
<label for="user_email">Email</label><br />
<input autofocus="autofocus" id="user_email" name="user[email]" type="email" value="" />
</div>
<div>
<label for="user_password">Password</label><br />
<input id="user_password" name="user[password]" type="password" />
</div>
<div>
<label for="user_password_confirmation">Password confirmation</label><br />
<input id="user_password_confirmation" name="user[password_confirmation]" type="password" />
</div>
<div><input name="commit" type="submit" value="Sign up" /></div>
</form>
How do I need to change the form to trigger password suggestions
are there any usable documentation anywhere about that feature?
Apple accepts new autocomplete properties: current-password and new-password
I had the same issue with my site which is dedicated to password generation test cases to improve password generators.
As outlined in a [PDF] guide made by Apple the autocomplete property now accepts set values to help with this issue.
See the spec here along with other valid values: https://html.spec.whatwg.org/multipage/forms.html#attr-fe-autocomplete-new-password
<form method="post" action="/tests/4/register-submit" >
<label>
<div>Name</div>
<input
name="name"
placeholder="name"
autocomplete="name"
type="text"
pattern=".{4,}"
title="Needs to be 4 characters long."
required
/>
</label>
<label>
<div>Username</div>
<input
name="username"
placeholder="Username"
type="text"
autocomplete="username"
pattern=".{4,}"
title="Needs to be 4 characters long."
required
/>
</label>
<label>
<div>Password</div>
<input
name="password"
placeholder="Password"
type="password"
autocomplete="new-password"
required
/>
</label>
<input type="submit" value="Register" />
</form>
That code works due to the autocomplete="new-password" property used. autocomplete="current-password" is also possible for login forms.
This has been tested as working by the very helpful: #simevidas
I've tested your code, and it successfully suggested a password. So you have a problem other than your HTML.
Ensure the following are true:
Your server is properly outputting your web page as HTML content, with response code 200. (You can see this using any browser's developer tools.)
You're on the latest version of Safari (7.+)
AutoFill usernames and passwords is checked in Safari > Preferences > Passwords.
Try removing all saved passwords for your domain in Safari.
You have Keychain checked On in iCloud (System Preferences > iCloud)
Maybe adding an autocomplete="on" attribute to the form or input-tag works.
http://www.w3schools.com/HTML/html5_form_attributes.asp

Unable to use mouse on text fields, have to use tab

I've had this weird situation just popup where I'm unable to use my mouse on a form I'm creating. It's requiring me to tab through the text fields. if I click on the second field it just pushes me back to the first field, i have to tab!
this is the form totally simple, it has something to do with the labels but I have never had issues before.
BTW: no JS or CSS in this form or page
my example:
<form>
<label for="username"*Username label>
<input type="text" name="username" tabindex="1" id="username">
<label for="password"*Password*label*>
<input type="password" name="password" tabindex="2" id="password">
<input type="submit" class="button" value="Login" name="submit" >
</form>
This is the proper way to format inputs with labels. This should fix your problem.
<label for="username">*Username*<input type="text" name="username" tabindex="1" id="username"/></label>
<label for="password">*Password*<input type="password" name="password" tabindex="2" id="password"/></label>
demo: http://jsfiddle.net/ZFZgt/

No 'Save Password' Prompt by any browser for my form

My form is attached below, and I have tried many things I've found in other forums, but to no avail. I cant get the browser to prompt a 'Save Password'. Where am I going wrong. Hope someone can help. Thanks.
<form id="frmlogin" action="/index" method="post" enctype="application/x-www-form-urlencoded" autocomplete="on">
<label id="landing_username" class="required" for="username">Username/Email</label>
<input id="landing_username" name="username" type="text" value="" name="username" />
<label id="landing_password" class="required" for="password">Password</label>
<input id="landing_password" name="password" type="password" value="" name="password" />
<submit id="loginbtn" onclick="LoginFun()" type="submit" name="loginbtn">Login</submit>
</form>
Try to clean the HTML a bit, maybe it helps:
<form id="frmlogin" action="/index" method="post">
<label id="landing_username" class="required" for="username">Username/Email</label>
<input id="username" name="username" type="text" />
<label id="landing_password" class="required" for="password">Password</label>
<input id="password" name="password" type="password" />
<input id="loginbtn" onclick="LoginFun()" type="submit" name="loginbtn" value="Login" />
</form>
the form attribute enctype is by default application/x-www-form-urlencoded so you don't need to specify it
the labels for attribute should contain the id, not the name of the associated input
element IDs should be unique
the attribute name is defined twice for both password and username
the attribute autocomplete is by default on
the input value is not required, so you don't need to add it to the inputs with an empty string
the submit button should be an input of type submit
Some of these changes are only optimizations and the code could work fine without them, but others, such as ensuring the unique id of each tag, are fixes and they are strongly recommended even if the browser displays the form properly.