Is there a size limit of form data that can be submitted?

G

Guy

If a form has a TEXTAREA and a SUBMIT button, how much text can a user type
in the textarea? What I mean is, what is the limit of characters that can
be submitted from the HTML form?

I can't imagine 2000 characters being sent in a URL so I suppose I would use
POST instead of GET, but does anyone know if and what the limit is?

Guy
 
B

brucie

If a form has a TEXTAREA and a SUBMIT button, how much text can a user type
in the textarea?

it depends on the user agent.
What I mean is, what is the limit of characters that can
be submitted from the HTML form?

pre HTML4 attribute values were limited to 1024 chars. HTML4 changed to
64k chars which is SGMLs max value however:

"These are the largest values permitted in the declaration. Avoid fixed
limits in actual implementations of HTML UA's"
http://www.w3.org/TR/html4/sgml/sgmldecl.html
 
H

Hywel Jenkins

brucie01 said:
it depends on the user agent.


pre HTML4 attribute values were limited to 1024 chars. HTML4 changed to
64k chars which is SGMLs max value however:

Was that 1024 limit on GET rather than POST, though? IIRC the limit was
quite ambiguous, depending on the UA, as you said, though Netscape
documentation mentioned 2,048 some time ago.
 
T

Toby A Inkster

Hywel said:
Was that 1024 limit on GET rather than POST, though?

Neither. It was a limit on the input control itself.

URLs do not have a limited length, so in particular, there is no limit to
the size of a GET request.

Certainly any sized file can be transmitted in an HTTP POST request (think
file upload forms), so the size of a POST request must also be unlimited.
 
B

brucie

Was that 1024 limit on GET rather than POST, though?

theres no distinction. attribute values are just 64k

HTTP1.1 says it puts no limit on the length of GET and servers should be
able to handle it but if they cant return a 414.

IE<3 url limit is 1k, IE3+ 2k. opera<3.2 is 256. opera 3.5+ is 1k. (may
be more now but i couldn't find it). couldn't find anything for NS/moz
 
L

Leif K-Brooks

Toby said:
URLs do not have a limited length, so in particular, there is no limit to
the size of a GET request.

Most servers do put a limit on GET length, though.
 
J

Jukka K. Korpela

brucie said:
theres no distinction. attribute values are just 64k

But attribute values are quite distinct from form field values.
Attribute values are something that resides in an HTML document,
whereas form field values are (normally) entered by the user.

In practical terms, it's best to stay well below 1024 characters,
though the actual limitations are usually somewhere around 2000.
More info: http://www.cs.tut.fi/~jkorpela/forms/methods.html#exc

(That means keeping URL length below 1024. And since you cannot know
the size of actual data submitted, it's safest you use method="POST"
for anything that isn't something like a search form submission with a
relatively small set of fields.)
 
B

brucie

But attribute values are quite distinct from form field values.
Attribute values are something that resides in an HTML document,
whereas form field values are (normally) entered by the user.

the way i was looking at it was that the text entered still ends up as
an attribute value of the element.
 
J

Jukka K. Korpela

brucie said:
the way i was looking at it was that the text entered still ends up
as an attribute value of the element.

Nope. If I have, say, <input type="text" name="foo"> and you type "bar"
into the text input box corresponding to this element, as created by a
browser, then "bar" does not become any attribute value. If I had
<input type="text" name="foo" value="brucie">, the situation would be
the same; the value of the form field "foo" would be "bar", and
"foo=bar" would be inserted by the browser into the form data set, and
hence into the URL (when method="GET" is used), but this would not
change the element's attributes the least. (The value attribute would
still be _relevant_ too, if the form contains a reset button, which
shouldn't normally be there, but I digress.)

The input data, which becomes the value of a field, might be
accessible, via a Document Object Model, as a property of an element.
If it's called attribute in that context, that's misleading, but still
does not change the HTML element's attributes the least.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top