Ver Mensaje Individual
  #4 (permalink)  
Antiguo 13/09/2007, 08:45
Avatar de JavierB
JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 22 años, 3 meses
Puntos: 772
Re: Ampliar caja de texto!!!

Hola de nuevo.

Tienes que utilizar una variable global para saber qué cuadro de texto ha tenido el foco:

Código PHP:
<html>
<
head>
<
script type="text/javascript">
var 
foco null;
function 
pulsar(e,obj) {
  if (
e.keyCode==13) {
    
foco.value obj.value;
    
obj.style.display 'none';
  }
}
</script>
</head>
<body>
<form>
<input type="text" name="txt1" onfocus = "foco=this; txt.style.display='block'; txt.value = this.value; txt.focus()" />
<input type="text" name="txt2" onfocus = "foco=this; txt.style.display='block'; txt.value = this.value; txt.focus()" />
<textarea name="txt" style="display:none" onkeypress = "return pulsar(event,this)"></textarea>
</form>
</body>
</html> 
Saludos,