tags:

views:

37

answers:

3

What's the largest number of bytes textarea can hold?

Thanks

EDIT I need it in the context of pasting to textarea from the clipboard. So, what's the max of the clipboard object?

+1  A: 

The W3C does not specify any limit.

Benoit
+1  A: 

HTML is a standard, not a technology. The maximum number of characters you can store in a field is based on the browser's implementation.

Sam Dufel
+1  A: 

I don't think there is a maximum specified anywhere. There are ways to enforce a maximum that makes sense for your application, but the browser should be able to send any arbitrary length to the server, as long as you are using the POST method.

If you are using the GET method, however, you are technically limited to 255 characters in the whole URL/query string, by RFC 2068:

Servers should be cautious about depending on URI lengths above 255 bytes, because some older client or proxy implementations may not properly support these lengths.

Many browsers will not give you problems, but if you are sending large requests, you should be using the POST method.

Also, keep in mind that just because there is no specified maximum, that doesn't mean that every browser will be able to handle extremely large amounts of data. It is possible that different browsers have different limits, but these are not widely documented. It is very rare that you will reach these limits, in any case.

pkaeding
Just a note on the URL limit; today, the recommendation is somewhere around 2000 characters. I don't think you should worry about too old technology
Onkelborg
@Onkelborg, That's a good point. I mainly wanted to mention that the OP should be using POST if he is sending large amounts of data.
pkaeding
@pkaeding: Yes, and there are more reasons than that, but.. :)
Onkelborg
@Onkelborg Indeed there are. I was trying to think of why the OP was asking this question in the first place. Most likely, he is having trouble with getting something to work. An oversize GET request was the only thing I could think of that would cause this to not work, and make him think there was a limit on the size of the textarea.
pkaeding
@pkaeding: Kind of suspected that :)
Onkelborg
Who is OP? If you are referring to me, please see the reason why I asked the question in the edited body. And, oh, I am a she:)
gnomixa
@gnomixa Yes, I was referring to you with 'OP' (Original Poster). I apologize for the gender pronoun mis-match.
pkaeding
no worries, I just thought it was funny that you guys were referring to some mythical OP and calling him "him".I get "him" all time. Guess I should put a photo.
gnomixa