maxlength - Maximum Length

Specifies a maximum number of characters that the user can enter into a control.

Category

basics

Syntax

maxlength="n"
Where n is an integer.

Usage

In Design mode, click the top tab under Properties and look for Maximum length, or click All Properties and look for maxlength under basics.

If you compute this value, make the script Compute on Page Load and return an integer value.

Examples

This Edit Box control has a different maximum length depending on user identity.
<xp:inputText id="inputText1" value="#{document1.subject}">
	<xp:this.maxlength>
		<![CDATA[${javascript:if (session.getCommonUserName() == "anonymous") {
			return 24
		} else {
			return 80
		}}]]>
	</xp:this.maxlength>
</xp:inputText>