RobinHerbots / Inputmask

Input Mask plugin
https://robinherbots.github.io/Inputmask/
MIT License
6.4k stars 2.17k forks source link

Can't seem to get inputmask to work #2312

Open gsavage323 opened 4 years ago

gsavage323 commented 4 years ago

I installed input mask from NUGET package manager. In my main layout page I included jquery3.4.1 and inputmask.min.js vs 2.0.5 in the head. And then on the page I intend to use the input mask I use the following script in a $(document).ready(funtion(){ $("#txtPhone").inputmask({mask:"(999) 999-9999"}); }) But when I open the page the mask doesn't work. Any ideas? Just for clarity I will post the entire head script and style section

<script src="~/Scripts/jquery-3.4.1.min.js"></script>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="~/Scripts/inputmask/inputmask.min.js"></script>

I also get this error in console when I run the page: jquery-3.4.1.min.js:2 Uncaught TypeError: $(...).inputmask is not a function at HTMLDocument. (AddUsers:159) at e (jquery-3.4.1.min.js:2) at t (jquery-3.4.1.min.js:2)

One more point of clarity I am running the site in Chrome Version 80.0.3987.163 (Official Build) (64-bit)

RobinHerbots commented 4 years ago

Which version did you use?

gsavage323 commented 4 years ago

2.0.5

RobinHerbots commented 4 years ago

Do you mean 5.0.2? There is no version 2.0.5 on nuget.

gsavage323 commented 4 years ago

Correct it is 5.0.2

RobinHerbots commented 4 years ago

@gsavage323 ,

Ypu need to include the jquery.inputmask....

gsavage323 commented 4 years ago

I included jquery.inputmask and it still does not work and give an error in the console log

RobinHerbots commented 4 years ago

Can you provide some more information.

I also should push a newer version to nuget

MrCsabaToth commented 4 years ago

This could even be #2285 . That's what I have as well: once inputmask's initialization fails, all consecutive actual usage of inputmask will also fail too. @gsavage323 check if you have a preceding exception like quoted in #2285 before you got the exception about .inputmask(...).