jquery-mask

Why does jQuery mask say it's not a function?

梦想与她 提交于 2021-02-06 08:39:50
问题 When trying to use the jQuery mask() function, I get the following error in the console: TypeError: $(...).mask is not a function This is a sample of my code where this is happening: <html> <body> <input type='text' id='phone' /> </body> <script src="http://code.jquery.com/jquery-1.11.2.min.js"></script> <script> //alert($); $(document).ready(function(){ $("#phone").mask("(99) 9999-9999"); }); </script> </html> How do I fix this? 回答1: Jquery mask is a plugin. You can directly add this line in

jQuery Mask Plugin: mask for negative integers

别等时光非礼了梦想. 提交于 2020-01-02 06:58:07
问题 I am using jQuery Mask Plugin in my web project. It is used widely and I don't want to change it for now. I use the following mask for the numbers with decimal separators: For example for the element: <input class="number-field" value="123456"> I use the following mask: $('input.number-field').mask('#,##0', {'reverse': true}); It works for positive numbers, but now I would like to add support of negative numbers. Neither of the following patterns work: $('input.number-field').mask('#,##0Z', {

jQuery Mask Plugin: mask for negative integers

故事扮演 提交于 2020-01-02 06:58:04
问题 I am using jQuery Mask Plugin in my web project. It is used widely and I don't want to change it for now. I use the following mask for the numbers with decimal separators: For example for the element: <input class="number-field" value="123456"> I use the following mask: $('input.number-field').mask('#,##0', {'reverse': true}); It works for positive numbers, but now I would like to add support of negative numbers. Neither of the following patterns work: $('input.number-field').mask('#,##0Z', {

Jquery Mask number with commas and decimal

a 夏天 提交于 2020-01-01 04:58:26
问题 I am using a Jquery mask plugin to format many things on my site and I am trying to figure out how to get it to format numbers in the way I need. I am using the following plugin. https://igorescobar.github.io/jQuery-Mask-Plugin/ I am attempting to get the following format for my numbers. 999,999,999.99 The number is a currency field that needs a comma added every three digits and the value can be as low as 0.00 回答1: Well, this worked. I just tweaked the example from the website changing dots

jquery masked input have only first number optional rest mandatory

北城以北 提交于 2019-12-22 04:58:13
问题 Im using jquery masked input plugin and need to have a phone field with the following format: 1 (222) - 000 - 1114 my code looks like this: $("#myPhone").mask("9 (999) - 999 - 9999"); now i cant seem to get it to work to make the first digit optional but the rest mandatory. So the following numbers are valid : 1 (222) - 000 - 1114 (222) - 000 - 1114 and the following numbers are invalid 1 (222) - 000 - 11 (222) - 00 - 0011 using "?9 (999) - 999- 9999" will not work since it makes the whole

jquery mobile input masking not working

怎甘沉沦 提交于 2019-12-12 20:21:23
问题 I am trying to mask SSN input using jquery mask plugin, however it doesn't seem to play well with jquery mobile. The code is here. Appreciate any help. If this doesnt work, what are the alternatives? Also copied the code for reference below: 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

jquery money masking input with negative integer only

大憨熊 提交于 2019-12-12 04:05:19
问题 I am trying to mask input only with optional negative or positive integers. I tried using jQuery(function($){ $.mask.definitions['~']='[-]?'; $("#eyescript").mask("~?999999999"); }); but this is allowing any character at the first place. (Eg: f12, -12, +12, /12, etc..) I want the user to strictly use only '-' or any number in the first position. How can I do this? 回答1: Actually, I think I found the answer. Added one integer or negative sign as optional and reduced one 9 from the mask to

jquery masked input have only first number optional rest mandatory

爱⌒轻易说出口 提交于 2019-12-05 05:33:08
Im using jquery masked input plugin and need to have a phone field with the following format: 1 (222) - 000 - 1114 my code looks like this: $("#myPhone").mask("9 (999) - 999 - 9999"); now i cant seem to get it to work to make the first digit optional but the rest mandatory. So the following numbers are valid : 1 (222) - 000 - 1114 (222) - 000 - 1114 and the following numbers are invalid 1 (222) - 000 - 11 (222) - 00 - 0011 using "?9 (999) - 999- 9999" will not work since it makes the whole thing optional If this cant be done in masked can someone help me out with regular expression to achieve

Jquery Mask number with commas and decimal

时间秒杀一切 提交于 2019-12-03 12:47:41
I am using a Jquery mask plugin to format many things on my site and I am trying to figure out how to get it to format numbers in the way I need. I am using the following plugin. https://igorescobar.github.io/jQuery-Mask-Plugin/ I am attempting to get the following format for my numbers. 999,999,999.99 The number is a currency field that needs a comma added every three digits and the value can be as low as 0.00 Well, this worked. I just tweaked the example from the website changing dots with commas and it worked. $('.money').mask("#,##0.00", {reverse: true}); <script src="https://ajax