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?
Thanks
| SitePoint Sponsor |





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?
Thanks



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".
Birnam wood is come to Dunsinane
Also try to ask the server if they are truncating the sent data.
Bookmarks