Skip to content

neovav/phonemask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

phonemask

Library for processing the phone input field in the web form. Only native javascript is used

Usage:

  1. Adding a library to HTML
<script type="application/javascript" src="src/phonemask.js"></script>

or

<script type="application/javascript" src="src/phonemask.min.js"></script>
  1. Adding a phone input field to HTML
<input type="text" class="form-control" id="phone" name="phone" value="+38 (0__) ___ - __ - __" mask="+38 (0__) ___ - __ - __" placeholder="+38 (0__) ___ - __ - __">
  1. Adding javascript code to initialize the phone input field handler by mask
<script type="text/javascript">
    const cssPhone = 'input[name="phone"';
    (new phoneMask()).init(cssPhone);
</script>

About

Library for processing the phone input field in the web form. Only native javascript is used

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published