JQuery mobile input lock not working

I am trying to mask the SSN input using the jquery mask plugin, however it doesn't seem to work with jQuery mobile. The code is here . Appreciate any help.

If this does not work, what are the alternatives?

The code for the link below is also copied:

Scripts:

jquery.mobile-1.0.1.min.css jquery-1.6.4.min.js jquery.mobile-1.0.1.min.js $("#ssnprimary").mask("999-99-9999"); 

HTML:

  <div data-role="page" id="mainpage"> <div data-role="header"> <h1> My Test </h1> </div><!-- /header --> <div data-role="content"> <div class="content-primary"> <form id="fmain" data-ajax="false"> <!-- Primary SSN --> <div data-role="none"> <label for="ssnprimary">SSN:</label> <input type="tel" name="ssnprimary" id="ssnprimary" value="" /> </div> </form> <br /> </div><!-- /content --> </div><!-- /content --> <div data-role="footer" data-theme="d"></div><!-- /footer --> </div><!-- /page one --> 
+2
source share
2 answers

You did not enable javascript for the jQuery plugin to mask the inputs.

I tried editing your violin but did not show the result. So I created a new fiddle: http://jsfiddle.net/7MhAU/

+1
source

If you use the โ€œMasked Input plugin for jQueryโ€ from digitalbush.com, the problem is , the browser of the mobile device does not trigger the keystroke and / or keystroke events that the plugin uses . Using the built-in browser on my Android 2.3 device and typing with a numeric keypad has no effect. The cursor just sits at the beginning of the input field and blinks.

+1
source

Source: https://habr.com/ru/post/943833/


All Articles