Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Answer: How do you limit textarea of a form

by ZZamboni (Curate)
on May 25, 2000 at 03:11 UTC ( #14689=categorized answer: print w/replies, xml ) Need Help??

Q&A > input and output > How do you limit textarea of a form - Answer contributed by ZZamboni

Or if you want to remove blank lines:
s/\n{2,}/\n/g;
If you want to clump everything into a single line (maybe for reformatting it yourself, see Text::Wrap or my Nicely format a list or a string snippet):
s/\s+/ /g;
If you want to cut it to the first 5 non-empty lines:
$text=join("\n",(split(/\n+/,$text))[0..4])
I don't think there is an HTML attribute to restrict the number of lines in a TEXTAREA.

--ZZamboni

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
[erix]: yeah, SQLite may well be the most-used SQL database on earth
[ambrus]: erix: further, SQLite may be the second most installed piece of software on earth after zlib.

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2017-09-25 14:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (280 votes). Check out past polls.

    Notices?