We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Trusted by the world’s leading companies

Syncfusion Trusted Companies

Overview

The JavaScript Input Mask or masked textbox is a control that provides an easy and reliable way to collect user input based on a standard mask. It allows you to capture phone numbers, date values, credit card numbers, and other standard format values.


Standard mask

The HTML5/JavaScript input mask control supports the standard masks listed on MSDN.


Custom mask

Other than the standard mask elements, any custom character also can be a mask element by defining rules for it.


Regular expression

The mask elements can be regular expressions, which is useful when defining user-specific data such as IP addresses.


Mask input combinations

The HTML5 input mask control allows different mask combinations based on the standard and custom masks. So, you can form different mask formats based on your application scenarios.

HTML5 input mask with number masking

Number mask

From the standard mask elements, form a number mask for capturing any finite-length number to get number inputs such as phone numbers and credit card numbers.

HTML5 input mask with string masking

String mask

In the case of a country code or product key input, where the input string requires uppercase characters, the string mask format will enforce this.

HTML5 input mask with date masking

Date mask

The mask can form any date format to get similarly formatted date values. This is helpful in getting culture-specific date values by defining the corresponding date mask.


Form support and validation

As a form component, the captured value of a masked textbox control proceeds in the raw format when submitting the form.

You can also integrate the form validator plugin to perform any custom validation.


HTML5 input type support

You can create the masked textbox control from the HTML5 tel input. It opens the numeric keypad on mobile devices, which is useful for obtaining phone numbers or any other number-only inputs.

JavaScript input mask with mobile numeric keypad support


Other supported frameworks

The Input Mask component is also available in Blazor, React, Angular, and Vue frameworks. Check out the different Input Mask platforms from the links below,

Web accessibility

  • Fully supports WAI-ARIA accessibility to work with screen readers and assistive devices.
  • Follows WAI-ARIA best practices for implementing keyboard interaction.
  • Designs the UI element visuals such as foreground color, background color, line spacing, text, and images based on WCAG 2.0 standard.

Developer-friendly APIs

Developers can customize all UI elements and control behaviors of the JavaScript input mask according to the end user’s requirements using its rich set of client-side APIs.


JavaScript Input Mask Code Example

Easily get started with the JavaScript Input Mask using a few simple lines of HTML and TS code example as demonstrated below. Also explore our JavaScript Input Mask Example that shows you how to render and configure a Input Mask in JavaScript.

<div class="control-section">
    <div class="content-wrapper">
        <div class="control-label">Mobile Number
        </div>
        <input id="mask1" type="text" />
        <div class="control-label">Country ISO Code
        </div>
        <input id="mask2" type="text" />
        <div class="control-label">D.O.B
        </div>
        <input id="mask3" type="text" />
        <div class="control-label">Product Key
        </div>
        <input id="mask4" type="text" />
    </div>
</div>
import { loadCultureFiles } from '../common/culture-loader';
import { MaskedTextBox } from '@syncfusion/ej2-inputs';

    loadCultureFiles();
    // Render Masked Textbox with default mask
    let mask: MaskedTextBox = new MaskedTextBox({
        mask: '000-000-0000'
    });
    mask.appendTo('#mask1');

    let mask2: MaskedTextBox = new MaskedTextBox({
        mask: '>LL / LLL'
    });
    mask2.appendTo('#mask2');

    let mask3: MaskedTextBox = new MaskedTextBox({
        mask: '00/00/0000'
    });
    mask3.appendTo('#mask3');

    let mask4: MaskedTextBox = new MaskedTextBox({
        mask: '>AAAAA-AAAAA-AAAAA-AAAAA'
    });
    mask4.appendTo('#mask4');



70+ JAVASCRIPT UI CONTROLS

Frequently Asked Questions

The Syncfusion JavaScript Input Mask provides the following features:

  • Allows users to enter only valid data through the input mask.
  • Supports custom mask formats with regular expressions (regex) to validate application-specific data.
  • Allows the validation of specific data formats such as phone numbers and date masks with different mask combinations.
  • One of the best JavaScript Input Mask in the market that offers feature-rich UI to interact with the software.
  • Simple configuration and API.
  • Supports all modern browsers.
  • Expansive learning resources such as demos and documentation to learn quickly and get started with JavaScript Input Mask.

We do not sell the JavaScript Input Mask separately. It is only available for purchase as part of the Syncfusion JavaScript suite, which contains over 70 JavaScript components, including the Input Mask. A single developer license for the Syncfusion Essential Studio for JavaScript suite costs $995.00 USD, including one year of support and updates. On top of this, we might be able to offer additional discounts based on currently active promotions. Please contact our sales team today to see if you qualify for any additional discounts.

You can find our JavaScript Input Mask demo here.

No, our 70+ JavaScript components, including Input Mask, are not sold individually, only as a single package. However, we have competitively priced the product so it only costs a little bit more than what some other vendors charge for their Input Mask alone. We have also found that, in our experience, our customers usually start off using one of our products and then expand to several products quickly, so we felt it was best to offer all 70+ JavaScript components for a flat fee of $995/developer. On top of this, we might be able to offer additional discounts based on currently active promotions. Please contact our sales team today to see if you qualify for any additional discounts.

No, this is a commercial product and requires a paid license. However, a free community license is also available for companies and individuals whose organizations have less than $1 million USD in annual gross revenue and five or fewer developers.

A good place to start would be our comprehensive getting started documentation.

Read independent,
authenticated reviews
on G2

Download Now Pricing

What do our customers say about us?

double quotes

We're using the file formats and Windows/JavaScript list controls a lot. They're fast, easy to use, and the documentation is good and contains examples. Tickets with questions or suggestions were answered within a day, so we're happy to use the Syncfusion libraries.
Daniel Persidok

Daniel Persidok

wpd onshore GmbH & Co. KG

double quotes

Using Syncfusion Angular and JavaScript controls makes front-end web development a piece of cake. Each component has many properties that can be configured as per your desire, methods that can be used to interact with the element, and a lot of events that trigger at different stages, which makes modifying your components according to the state of the application an easy task. Also, their support is amazing! They always offer a sample working project, which makes it very simple to solve your question about your code.
Carlos Rodriguez Garcia

Carlos Rodriguez Garcia

Vistatec

Transform your applications today by downloading our free evaluation version Download Free Trial

Awards

Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion is proud to hold the following industry awards.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile