• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maxlength for textarea not being set properly

 
K Robert
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are starting at index 0 and ending at 150. Subtract 1 from the end.

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic