03/05/2007, 17:00
|
| | Fecha de Ingreso: enero-2006 Ubicación: México
Mensajes: 117
Antigüedad: 19 años Puntos: 0 | |
Re: POner limite a textarea checate esto espero que te sirva
<HEAD>
<style type="text/css">
<!--
BODY {
font-family: Arial, Verdana, Geneva, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold;
color: Black;
margin-left: 0px;
margin-right: 0px;
background-color: White;
}
.minitext {
font-family: Arial, Verdana, Geneva, Helvetica, sans-serif;
font-size: 8pt;
font-weight: normal;
color: Black;
}
.0 {
background-color: #4786D2;
}
.1 {
background-color: #D3E8FD;
}
.2 {
background-color: #D3E8FD;
}
.3 {
background-color: #D3E8FD;
}
.4 {
background-color: #D3E8FD;
}
TABLE {
font-family: Arial, Verdana, Geneva, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold;
color: Black;
}
INPUT.text {
background-color: #FFFFFF;
color: Black;
border: 2px ridge Black;
font-size: 10px;
font-family: Verdana, Arial;
font-weight: normal;
}
.enable {
background-color: #77FF77;
font-weight: bold;
color: Black;
}
.disable {
background-color: red;
font-weight: bold;
color: Black;
}
-->
</style>
<script type="text/javascript">
<!--
function getObject(obj) {
var theObj;
if(document.all) {
if(typeof obj=="string") {
return document.all(obj);
} else {
return obj.style;
}
}
if(document.getElementById) {
if(typeof obj=="string") {
return document.getElementById(obj);
} else {
return obj.style;
}
}
return null;
}
//Contador de caracteres.
function Contar(entrada,salida,texto,caracteres) {
var entradaObj=getObject(entrada);
var salidaObj=getObject(salida);
var longitud=caracteres - entradaObj.value.length;
if(longitud <= 0) {
longitud=0;
texto='<span class="disable"> '+texto+' </span>';
entradaObj.value=entradaObj.value.substr(0,caracte res);
}
salidaObj.innerHTML = texto.replace("{CHAR}",longitud);
}
//-->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<form action="#" method="post">
<table align="center" class="0" border="0" cellspacing="1" cellpadding="5">
<tr>
<td class="2">
<textarea class="text" id="eBann" name="bannerURL" maxlength="10" size="60" onKeyUp="Contar('eBann','sBann','{CHAR} characters ',10);"></textarea>
<br>
<span id="sBann" class="minitext">10 characters left.</span></td>
</tr>
</table>
</form>
</BODY>
__________________ Where is my mind?.... |