www.fgks.org   »   [go: up one dir, main page]

Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
HTML and CSS
Properties
 maxLength Property
MAXLENGTH Attribute | maxLength Property

Sets or retrieves the maximum number of characters that the user can enter in a text control.

Syntax

HTML<ELEMENT MAXLENGTH = iLength... >
Scripting[ iLength = ] object.maxLength [ = v ]

Possible Values

iLengthInteger that specifies or receives the maximum length of the input.

The property is read/write. The property has no default value.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see About Dynamic Properties.

Remarks

The maxLength property limits the number of characters the user can enter. The property does not limit programmatic assignments to the value property. The property's value can be larger than the size of the text box, in which case the text box scrolls as the user types.

Standards Information

This property is defined in HTML 3.2 World Wide Web link and is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 World Wide Web link.

Applies To

INPUT type=text, INPUT type=password

See Also

size
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content      
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker
DCSIMG