Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/02/2008, 12:23
albertcito
 
Fecha de Ingreso: diciembre-2007
Mensajes: 169
Antigüedad: 17 años, 2 meses
Puntos: 6
Ayuda: Cambiar con onblur el type de un input de text a password

este es el input:

<input type="text" id="password" onfocus = "inputOnFocus(this,' Clave');" onBlur="inputOnBlur(this,' Clave');" value=" Clave" />


eventos javascript:
Código:
	function inputOnFocus(id,texto)
	{
		if(id.value == " Clave")
			id.type = "password";	//linea con problemas en IE
		if(id.value == texto)
			id.value = "";		
		return true;
	}
	
	function inputOnBlur(id,texto)
	{
		if(id.value.length == 0)
			id.type = "text"; //linea con problemas en IE	
		if(id.value.length == 0)
			id.value = texto;
		return true;
	}
Funciona en Firefox pero no en IE alguien sabe como hacerlo funcionar en IE???


Sorry!.. aquí encontré algo de ayuda:

http://www.forosdelweb.com/f13/efecto-asteriscos-campo-contrasena-473277/

Última edición por albertcito; 12/02/2008 a las 12:29