I use this in the html head:
<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
function textarea_counter(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;
}
</script>
Add this to the textarea, where 500 is the maxlength:
onkeyup="textarea_counter(this.form.fieldname,this.form.fieldname_count,
500)"
And add this below the textarea: <input disabled readonly type=text
name="fieldname_count" size=3 style="font-size : 10px; text-align : right"
value="500">
----- Original Message -----
From: "Nick Varner" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, September 18, 2002 8:32 AM
Subject: textarea
> Since there is not a cftextarea, how do I through up an alert in
javascript
> telling the user they have entered to many characters in a textarea. I
know
> this is off subject but any help would be appreciated.
>
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists