---
title: validityState.tooLong
slug: Web/API/ValidityState/tooLong
tags:
  - API
  - Constraint Validation API
  - DOM
  - NeedsExample
  - Property
  - Reference
browser-compat: api.ValidityState.tooLong
---


The read-only **`tooLong`** property of a **[`ValidityState`](/en-US/docs/Web/API/ValidityState)** object indicates if the value of an {{HTMLElement("input")}} or {{HTMLElement("textarea")}}, after having been edited by the user, exceeds the maximum code-unit length established by the element's [`maxlength`](/en-US/docs/Web/HTML/Attributes/maxlength) attribute.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- [Constraint validation](/en-US/docs/Web/Guide/HTML/Constraint_validation)
- [Forms: Data form validation](/en-US/docs/Learn/Forms/Form_validation)
