Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/11/2008, 09:43
PakO_okAp
 
Fecha de Ingreso: julio-2006
Mensajes: 8
Antigüedad: 17 años, 9 meses
Puntos: 0
Pregunta Ayuda con codigo en textbox

El codigo es el siguiente, pero no se como hacerle para que no nadamas lea una sola letra , si no toda una palabra, es que me dejaron hacer un anuario, y cuando mis compañeros pongan su numero de control en el textbox inmediantamente se redireccione hacia la pagina que le asignare con sus datos , por ejemplo un compañero llamado sergio al poner su nombre se ira a su pagina www.mianuario.com/sergio.html

<html>
<head>
<LINK REL="stylesheet" TYPE="text/css" HREF="css/estilos.css">
<script language="JavaScript">
<!--
function pulse(hau,e)
{
var evt = e ? e : event;
var key = window.Event ? evt.which : evt.keyCode;
//alert("He pulsado la tecla: "+key);
if(key==71)
{
location.href='http://www.google.es/';
}
if(key==65)
{
location.href='http://www.alphacom.es/';
}
if(key==89)
{
location.href='http://www.yahoo.es/';
}
if(key==72)
{
location.href='http://www.hotmail.com/';
}

}
//-->
</script>
<DIV ID="Capa" STYLE="position: absolute; left:200px; top:50px; width:700px; height:500px; background-color:#FF0000">
</head>

<body bgcolor="#182345" topmargin=0 leftmargin=0 >
<center><br>
<h1>Presione la Tecla Indicada para ir a la web.</h1><br><br>
<input type="text" onkeydown="pulse(this,event)"/><br><br>
<h2>A = www.alphacom.es <br>
G = www.google.es <br>
Y = www.yahoo.es <br>
H = www.hotmail.com <br></h2>

</center>
</body>
</html>