Make passwords visible (Technics)
Hi,
<input type="password">
is only useful if somebody might be looking over your shoulder.
If nobody does, it's more user-friendly to echo the password legible.
What about this:
<input id="password" type="password" name="userpw" size="25" /><span id="pw_show"> </span>
<script type="text/javascript">/* <![CDATA[ */
function on_off(pa)
{literal}{{/literal}
if (pa.checked) document.forms[1].elements["password"].type="text";
else document.forms[1].elements["password"].type="password";
{literal}}{/literal}
if (!(/MSIE/.test(navigator.userAgent)))
{literal}{{/literal}
var sh_inner='<input type="checkbox" name="show_pw" id="show_pw" onclick="on_off(this);" /><label for="show_pw">Passwort sichtbar machen</label>';
document.getElementById("pw_show").innerHTML=sh_inner;
{literal}}{/literal}
/* ]]> */</script>
Didn't work in IE so I blocked that "browser" from this function. (Any JS experts?)
See that in action at Schreibkunst
Arnd