esto lo saque de los viejos foros
espero te ayude, aunque es javascript
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>
<SCRIPT language="Javascript" type="text/javascript">
<!--
// Este genial Script fue desarrollado por Tukzone, SirMatrix y Unknow, todos usuarios del Foro.. Gracias a ellos por su colaboración
function storeCaret(text) {
if (text.createTextRange) {
text.caretPos = document.selection.createRange().duplicate();
}
}
function meter(text) {
var postopic=document.PostTopic.Message
if (postopic.createTextRange && postopic.caretPos) {
var caretPos = postopic.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ?text + ' ' : text;
}
else postopic.value += text;
postopic.focus(caretPos)
}// -->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Ronnie T. Moore -->
<!-- Web Site: The JavaScript Source -->
<!-- Dynamic 'fix' by: Nannette Thacker -->
<!-- Web Site:
http://www.shiningstar.net -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!!
http://javascript.internet.com -->
<!-- Begin
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
countfield.value = maxlimit - field.value.length;
}
// End -->
</script>
<body>
<center><form action="post_info.asp" method="post" name="PostTopic" onSubmit="return disableForm(this);">
<textarea onKeyDown=textCounter(this.form.Message,this.form. remLen,2000); onKeyUp=javascript
:storeCaret(this);textCounter(th is.form.Message,this.form.remLen,2000); name=Message onchange=javascript
:storeCaret(this); onclick=javascript
:storeCaret(this); rows=10 wrap=VIRTUAL cols=45></textarea><br>
Tiene <input readonly type=text name=remLen size=5 maxlength=3 value="2000"> caracteres para su mensaje
<input name="Submit" type="submit" value="Enviar mensaje">
<input name="Reset" type="reset" value="Limpiar forma"></form></center>
</BODY></HTML>