# maxLength Attribute (editWith Element)

Specifies the maximum number of characters allowed for plain single line text boxes.

## Type

`xsd:simpleType`

## Parent Elements

Element | Description
--- | ---
editWith | Specifies an instance of an editing component, and provides the corresponding parameters to determine its exact behavior.

## Definition

    <xsd:attribute name="maxLength" use="optional" >
      <xsd:simpleType>
        <xsd:restriction base="xsd:integer">
          <xsd:minInclusive value="-1" />
          <xsd:maxInclusive value="9999" />
        </xsd:restriction>
      </xsd:simpleType>
    </xsd:attribute>

## Remarks

The maxLength attribute is only valid for plain-text edit controls that do not allow paragraph breaks. Such controls correspond to editWith elements with a component attribute set to "xField" and a type attribute set to "plain" (or without a type attribute specified).

Note This item is not supported when the Disable Service Pack features option on the Advanced tab of the Options dialog box in InfoPath is selected or when Microsoft Office 2003 Editions Service Pack 1 or later is not installed. Any form defined by a form definition file (.xsf) that includes this item cannot be opened in InfoPath when service pack features are disabled or unavailable.

## Example

The following is an example of the maxLength attribute as it is used in the editWith element:

    <editWith component="xField" maxLength="100">

©2003-2004 Microsoft Corporation. All rights reserved. Permission to copy, display and distribute this document is available at: http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp