
13/02/2002, 13:16
|
 | Colaborador | | Fecha de Ingreso: diciembre-2001 Ubicación: Curaçao (Antillas Holandesas)
Mensajes: 3.179
Antigüedad: 23 años, 3 meses Puntos: 38 | |
Re: Contador de caracteres Con esto lo podrías hacer, seguro hay soluciones mas elaboradas, pero esta cumple:
<html>
<head>
<script language="JavaScript">
var primeraVez = true;
function limpia(){
if (primeraVez){
document.formulario.mensaje.value = "";
primeraVez = false;
}
}
function cuenta(){
document.formulario.total.value = document.formulario.mensaje.value.length;
}
</script>
</head>
<body>
<form name="formulario">
<textarea name="mensaje" onfocus="limpia()" onKeyUp="cuenta()" rows="10" cols="50">
</textarea>
<input type="text" name="total" size="5" maxlength="3" disabled> Caracteres
</form>
</body>
</html> |