Tema: strings
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 22/03/2007, 03:45
Avatar de KarlanKas
KarlanKas
Moderador extraterrestre
 
Fecha de Ingreso: diciembre-2001
Ubicación: Madrid
Mensajes: 6.987
Antigüedad: 23 años, 2 meses
Puntos: 61
Re: strings


¿Así?

Código:
<html>
<head>
	<title>Untitled</title>
	<script>
	function contar(a){
		pepe=a.value.split("\n");
		juan=pepe[pepe.length-1]
		if(juan.length>12){
			pepe[pepe.length-1]=juan.substring(0,12)+"\n"+juan.substring(12,juan.length);
		}
		lolo=pepe.join("\n");
		a.value=lolo;
	}
	</script>
</head>

<body>
<textarea cols="19" rows="5" name="2323" onKeyUp="contar(this)"></textarea>


</body>
</html>
Un saludo!
__________________
Cómo escribir

No hay pregunta tonta, sino tonto que quiere seguir en la ignorancia.