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.
精彩评论