wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Maxlength for textarea  not being set properly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Maxlength for textarea  not being set properly" Watch "Maxlength for textarea  not being set properly" New topic
Author

Maxlength for textarea not being set properly

K Robert
Ranch Hand

Joined: May 16, 2003
Posts: 116
I have the current function to limit the amount of characters allowed in a text area:



My problem is that if I set it for "150", I get "151". From testing, it looks like it's not recognizing the first character space and starts the count at the #2 space in the text area.

Any thought?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You are starting at index 0 and ending at 150. Subtract 1 from the end.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Maxlength for textarea not being set properly
 
Similar Threads
text area character limit code without trimming
issue with a textbox on firefox.
problem in validating text area max length
Maximum number of lines in textarea
how to avoid copy pasting characters above the set limit in a text area.