Forum Moderators: open

Message Too Old, No Replies

How Much Text Can You be Assured Will Fit In an <input>?

How much text would a textchuck chuck if a textchuck could chuck text?

         

cmarshall

2:04 am on Aug 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I was asked a very interesting question by someone recently, and I've nary a clue.

What is the maximum amount of text that can be put into the value property of a <input type="hidden" /> XHTML element?

This chap wants to try cramming the contents of a <textarea> into a hidden form field (don't ask me why, but he usually has a good reason for it).

Any ideas?

encyclo

2:14 am on Aug 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



[w3.org...]
maxlength
= number [CN]
When the type attribute has the value "text" or "password", this attribute specifies the maximum number of characters the user may enter. This number may exceed the specified size, in which case the user agent should offer a scrolling mechanism. The default value for this attribute is an unlimited number.

So the specification allows for unlimited data in an

input
. Not that necessarily helps much in determining a browser's ability to handle "unlimited" quantities of data. ;)

daveVk

2:30 am on Aug 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I run a test on this some time ago, megabytes ( dont recall number ) Ok at least on IE.

cmarshall

2:53 am on Aug 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for the quick responses!

I'll point him here.

vincevincevince

3:01 am on Aug 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As I recall, the GET limit is much lower - so ensure he is sending by POST if he's going for really long strings.