It would be nasty if a database crashed or a disk got filled with terabytes of data, sent by some user out of ignorance, mistake, or malevolence.But in HTML, there is no way limit the number of characters entered by the user in a element.For these users, the 'valid' form of the textarea widget is a user-hostile control.The fundamental problem here is that there are two different mental models (and corresponding implementations) of "typing text".A Usenet article by Simon Brooke summarizes this well: Textareas are for input of larger amounts of text.Sometimes this text necessarily has arbitrarily long lines. Naive users, or users carrying expectations over from other software, become confused and disoriented either when the caret goes out of the viewport, or the viewport scrolls laterally.Users should be able to enter longer lines than this, so user agents should provide some means to scroll through the contents of the control when the contents extend beyond the visible area.
But if a "word" is longer than the textarea width, as set by the set to 20.
This function first determines the ASCII code of the keyboard key and then verifies that its ASCII code is within the range 48 to 57.
Especially in applications where data is entered to a database or stored onto disk on the server, some limitations must be imposed on the amount of data.
All browsers seem to allow the input of an unlimited number of lines in a textarea, except that there can be a browser-specific limit on the total number of characters. Internet Explorer and Opera) violate the above-cited principle on line length.
Instead of allowing users to scroll horizontally, they "soft wrap": when line length would exceed the visible width, they display the text in two or more lines.