maxlength Attribute


 

Where to use the maxlength Attribute


Description

The maxlength attribute specifies the maximum number of characters which may be accepted by input type="text" or input type="password" form controls. The user is prevented from entering more than this number of characters into the text field. In the absence of this attribute, there is no limit to the number of characters entered.

Note: It should not be assumed in the server processing script that you will never receive a value longer than this for the field in question - it is always possible, for example, to receive data from another form which does not have this restriction or for someone to alter the query string directly in the URI.

See also the size attribute.


Page Footer & Copyright

Copyright © Sally Maughan 2005-2009 (Page last updated on 16 May 2009)

*Valid XHTML 1.1 - hosted by *Openstrike

Content based on the W3C Working Draft: *XHTML 1.1 and Recommendation: *XHTML Modularisation 1.1.

W3C, XHTML, XML, HTML, CSS and MathML are *Trademarks of the W3C (*MIT, *ERCIM, *Keio) with which the site's author has no connection.


Up, Next & Previous Links

Your Location

Home > XHTML 1.1 Home > XHTML 1.1 Indexes > Attribute Index (XHTML 1.1) > maxlength Attribute (XHTML 1.1)