Split textarea content into two at maxlength and flow excedant content in another textarea

Posted by user1057339 on Stack Overflow See other posts from Stack Overflow or by user1057339
Published on 2011-11-21T08:40:04Z Indexed on 2011/11/21 9:49 UTC
Read the original article Hit count: 568

Filed under:
|

Wondering if its possible to create a short simple and sweet cross-browser jQuery (1.6) function that would split #textarea1 content into two by preserving the characters that amount to less than its var maxlength limit and transfering the remaining characters that exceed its maxlength limit in #textarea2. #textarea1 can push excedant in #textarea2, but if #textarea1 contains less than the maxlength limit, by default it wont get filled up with #textarea2 content, but you would have the option programatically to override this. I am just beginning to scratch the surface of jQuery but I noticed that this simple javascript can nearly do the trick, minus the free-flowing character movement. Scratching my head on this one. Thx a heap for any help. DC

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about textarea