Ver Mensaje Individual
  #4 (permalink)  
Antiguo 02/03/2008, 01:10
ch_xxii
 
Fecha de Ingreso: marzo-2008
Mensajes: 15
Antigüedad: 16 años, 11 meses
Puntos: 0
Re: Casilla Input password

Así es como lo resolví yo, espero que te sea útil.

<html>
<head>
<title></title>
</head>
<script language="javascript">
function codificar() {
var pws_real = document.frm.pws_real;
pws_real.value += String.fromCharCode(window.event.keyCode);
window.event.keyCode = 120;
}
function limpiar(obj) {
if (obj.value == '') {
obj.value='pws';
document.frm.pws_real.value = '';
}
}
</script>
<body>
<form name="frm" method="post">
<div style="display:none"><input type="password" id="pws_real" name="pws_real" value=""></div>
Usuario: <input type="text" name="usr" value="usr" onFocus="this.value=''" onBlur="if (this.value=='') this.value='usr'">
Clave: <input type="text" name="pws" value="pws" onFocus="this.value='';document.frm.pws_real.value =''" onBlur="limpiar(this)" onKeyPress="codificar()">
<input type="button" onClick="alert(document.frm.pws_real.value)" value="Ver Password">
</form>
</body>
</html>

Última edición por ch_xxii; 02/03/2008 a las 01:17