Skip to content

Instantly share code, notes, and snippets.

@mala
Created July 2, 2009 05:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mala/139283 to your computer and use it in GitHub Desktop.
Save mala/139283 to your computer and use it in GitHub Desktop.
<html>
<head>
<title>パスワードをマスクしないでパスワード保存も有効にする</title>
<script type="text/javascript">
function form_submit(event) {
var self = this;
if (this.__submit_by_js) return;
this.elements.password.type='password';
setTimeout(function() {
self.__submit_by_js = true;
self.elements.button.click();
}, 10);
event.stopPropagation();
event.preventDefault();
return false;
}
function password_focus(event) {
this.type="text";
}
function password_blur(event) {
this.type="password";
}
</script>
</head>
<body>
<form method="POST" onsubmit="form_submit.call(this, event);">
<dl>
<dt>ユーザーid</dt>
<dd><input type="text" name="login" value=""></dd>
<dt>パスワード</dt>
<dd>
<input type="password" name="password" value=""
onfocus="password_focus.call(this, event)"
onblur="password_blur.call(this,event)">
</dd>
<input type="submit" name="button">
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment