/BlazorInputMask

Blazor Input Mask

Primary LanguageHTML

Blazor Input Mask

Nuget Package : https://www.nuget.org/packages/BlazorInputMask/

Install-Package BlazorInputMask

Blazor Input Mask (based on https://imask.js.org/)

Use like that:

<EditForm Model="..

<InputMask @bind-Value="user.Telephone" class="form-control" data-mask="00.00.00.00.00" placeholder="Phone No" />

In your _Host.cshtml or Index.html file:

<script src="_content/BlazorInputMask/Main.js"></script>
<script src="_content/BlazorInputMask/IMask.js"></script>

You can also have the possibility to set an id to the mask (optional), and also retrieve the unmasked value.

06-29-2021 : Added parameter - validateOnKeyPress

Additional help in the demo code here :

https://github.com/raphadesa/BlazorInputMask/blob/master/BlazorInputMask/Pages/Index.razor

06-13-2021 : RegEx support

Usage : (RegEx must start and end with a slash '/')

<InputMask @bind-Value="user.Telephone" class="form-control" data-mask="/^\d+$/" placeholder="Phone No" />