You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Tommy-Carlos Williams (JIRA)" <ji...@apache.org> on 2013/02/22 01:18:12 UTC
[jira] [Commented] (CB-2522) Submitting password field via Ajax
prompts user if they want the browser to save the password
[ https://issues.apache.org/jira/browse/CB-2522?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13583724#comment-13583724 ]
Tommy-Carlos Williams commented on CB-2522:
-------------------------------------------
{noformat}
<div class="app">
<form id="loginForm">
<div><input type="text" name="username" id="username" placeholder="Username" /></div>
<div><input type="password" name="password" id="password" placeholder="Password" /></div>
<div><input type="submit" name="submit" id="submit" value="Submit" /></div>
</form>
</div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript">
var loginForm = document.getElementById("loginForm");
loginForm.addEventListener("submit", function(event) {
event.preventDefault();
var usernameInput = document.getElementById("username");
var username = usernameInput.value;
var passwordInput = document.getElementById("password");
var password = passwordInput.value;
var r = new XMLHttpRequest();
r.open("POST", "http://cordova.io/", true);
r.onreadystatechange = function () {
if (r.readyState != 4 || r.status != 200) return;
alert("login successful (not really).");
};
r.send("username=" + username + "&password=" + password);
}, false);
</script>
{noformat}
> Submitting password field via Ajax prompts user if they want the browser to save the password
> ---------------------------------------------------------------------------------------------
>
> Key: CB-2522
> URL: https://issues.apache.org/jira/browse/CB-2522
> Project: Apache Cordova
> Issue Type: Bug
> Components: Android
> Affects Versions: 2.3.0, 2.4.0
> Environment: Mac OS X 10.8.2 - using Cordova CLI
> Reporter: Tommy-Carlos Williams
> Assignee: Joe Bowser
>
> In Android, using even a basic form with username and password inputs, submitting the form via Ajax prompts the user: "Do you want the browser to remember this password?"
> Less than ideal for an app ;)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira