Ver Mensaje Individual
  #7 (permalink)  
Antiguo 16/09/2011, 20:25
Avatar de carlospc
carlospc
 
Fecha de Ingreso: noviembre-2008
Ubicación: Huancayo/Perú
Mensajes: 240
Antigüedad: 15 años, 6 meses
Puntos: 12
Respuesta: Ejecutar un boton al llegar a una cantidad determinada de caracteres

Cita:
Iniciado por dleal100 Ver Mensaje
jajajja me ganaste justamente ahorita ya tenia el codigo LOL

Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>titulo</title>
<script type="text/javascript">
function noce(){
var emo= document.getElementById("algo").value;
if(emo.length=="15")
{
///aca escribes tu codigo para que aga los que se te pegue la ganaaaaaaaaaaaaaaaa
document.getElementById("puke").innerHTML="<strong>EL CODIGO YA TIENE 15 DIGITOS LOL</strong>";
}


document.getElementById("caca").innerHTML=emo;

}
</script>
</head>
<body>
<form method="" action="">
escribe algo: <input type="text" id="algo" onkeydown="noce()" />
</form>

<div id="caca"></div>
<div id="puke"></div>



</body>
</html>
Si tambien estaria bien solo que el if estas comparando con "15" y no con 15 (cadena y no numero)
__________________
Mi web --> www.CarlosPC.net