Max length on a text input

Anyone know what the default maxlength is on an input?

If I don’t specify a maxlength, is there a limit to how much will get sent to the server?


According to w3c, the default value for the MAXLENGTH attribute is an unlimited number. So if you don’t specify the max a user could cut and paste the bible a couple of times and stick it in your form.

Even if you do specify the MAXLENGTH to a reasonable number make sure you double check the length of the submitted data on the server before processing (using something like php or asp) as it’s quite easy to get around the basic MAXLENGTH restriction anyway.

Also note that if you use method="get" (which is the default) there may be user agent-specific limitations on the resulting URI length. If you expect long string values, use method="post".

Also try to ask the server if they are truncating the sent data.


In my opinion, “maximum length depends upon you whatever you fix. but the default width is 145 in Firefox, 148 in safari and 146 in IE 7”. all measurements are in pixels.


No maxlength relates the ammount of data that can entered via the text box and not the physical length of the box. The “size” attribute controls the length of the box as displayed on the browser page.