The following should be of some help to you....

function limitArea(){
   content = document.form_name.text_area_name.value;
   len = content.length;
   if (len > 500) {
      content = content.substr(0,500);
   alert('Your input is limited to 500 characters.');
   document.form_name.text_area_name.value = content;
  }
}

<textarea name="text_area_name" cols="40" rows="5"
onKeyUp="limitArea();return true;" ...>

Feel free to modify the limitArea() function to optimize it a little bit...

Happy coding,
-Darron

----- Original Message -----
From: "Nick Varner" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, September 17, 2002 4:32 PM
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.
> 
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.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

Reply via email to