# robinherbots/inputmask

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/robinherbots-inputmask).**

6,460 stars · 2,119 forks · JavaScript · MIT

## Links

- GitHub: https://github.com/RobinHerbots/Inputmask
- Homepage: https://robinherbots.github.io/Inputmask/
- awesome-repositories: https://awesome-repositories.com/repository/robinherbots-inputmask.md

## Topics

`inputmask` `jqlite` `jquery-plugin` `maskedinput` `vanilla-javascript`

## Description

Inputmask is a JavaScript library that serves as a client-side input formatter and form input validator. It constrains text input fields to specific formats, such as phone numbers and dates, to ensure data consistency.

The project provides guided text entry and user input validation to prevent formatting errors. It standardizes how structured information is entered in web browsers to support more reliable server-side processing.

The library manages data validation and formatting by enforcing predefined patterns on user entry. It handles real-time input interception, cursor-position tracking, and the injection of dynamic placeholders to guide the user.

## Tags

### User Interface & Experience

- [Formatted Input Fields](https://awesome-repositories.com/f/user-interface-experience/formatted-input-fields.md) — Provides UI components that enforce specific data formats via masks for fields like dates and phone numbers. ([source](https://cdn.jsdelivr.net/gh/robinherbots/inputmask@5.x/README.md))
- [Event-Driven Input Handlers](https://awesome-repositories.com/f/user-interface-experience/form-and-input-management/input-handling/event-driven-input-handlers.md) — Captures keyboard and paste events to modify input values before they are committed to the DOM.
- [Form Input Validation](https://awesome-repositories.com/f/user-interface-experience/form-input-validation.md) — Enforces predefined patterns on user entry to prevent invalid data from being submitted in forms.
- [Guided Data Entry](https://awesome-repositories.com/f/user-interface-experience/guided-data-entry.md) — Provides visual cues and constraints that help users enter data in the correct format as they type.
- [Masked Inputs](https://awesome-repositories.com/f/user-interface-experience/masked-inputs.md) — Provides a JavaScript library for input fields that enforce specific character patterns and formatting rules.
- [Real-time Input Formatting](https://awesome-repositories.com/f/user-interface-experience/real-time-input-formatting.md) — Provides a mechanism to dynamically format user input as it is typed to match specific patterns in real time.
- [Cursor Position Mapping](https://awesome-repositories.com/f/user-interface-experience/cursor-position-mapping.md) — Implements logic to synchronize the text cursor position relative to formatted masked content during real-time entry.
- [Input Placeholders](https://awesome-repositories.com/f/user-interface-experience/data-to-visual-mappings/input-placeholders.md) — Provides visual symbols and guide characters within input fields to indicate the required format to the user.

### Software Engineering & Architecture

- [Regex Input Validation](https://awesome-repositories.com/f/software-engineering-architecture/application-lifecycle-management/configuration-management/automation-and-templating-frameworks/blueprint-input-configurations/input-restrictions/regex-input-validation.md) — Validates user keystrokes against predefined templates to determine if characters are permitted in the current position.
- [Mask-to-Raw Mappings](https://awesome-repositories.com/f/software-engineering-architecture/naming-conventions/rule-based-string-parsing/formatting-state-trackers/mask-to-raw-mappings.md) — Maintains a stateful mapping between the raw unformatted string and the displayed masked version to ensure data integrity.

### Web Development

- [Input Format Validations](https://awesome-repositories.com/f/web-development/string-format-validators/input-format-validations.md) — Verifies that user inputs meet specific numeric or string patterns for phone numbers and dates.
