Input.maxLength (Property)

The maximum length allowed for an input entry field.

Availability:

DOM level - 1
JavaScript - 1.5
JScript - 3.0
Internet Explorer - 4.0
Netscape - 6.0
Property/method value type:Number primitive
JavaScript syntax:-myInput.maxLength

This defines the maximum number of characters that are allowed to be entered into the input text field. The browsers differ in how they handle this value. Some will warn the user with a beep or flash on the screen, others simply stop accepting keystrokes when this number of characters have been entered.

See also:Password.maxLength, TextCell.maxLength