jquery-inputmask

regex allows one character (it should not) why?

对着背影说爱祢 提交于 2019-12-20 07:18:19
问题 Hello I am trying to create a regex that recognizes money and numbers being inputted. I have to allow numbers because I am expecting non-formatted numbers to be inputted programmatically and then I will format them myself. For some reason my regex is allowing a one letter character as a possible input. [\$]?[0-9,]*\.[0-9][0-9] I understand that my regex accepts the case where multiple commas are added and also needs two digit after the decimal point. I have had an idea of how to fix that

Range 0-100 using jQuery inputmask plugin

狂风中的少年 提交于 2019-12-12 11:10:08
问题 How can I create mask for range from 0 to 100? $(document).ready(function() { $("#masked").inputmask(???); }); 回答1: You can use the jquery.inputmask.regex.extensions.js for that. You can find the raw js with all extensions on this link. The github part about the regex extension (and all the other extensions) can be found on jquery.inputmask#regex-extensions. When you have that extension included, you can simply use the following regex: ^[1-9][0-9]?$|^100$ This matches 1 or 2 digits and the

How do I apply a custom alias inputmask using jquery?

不问归期 提交于 2019-12-12 03:43:38
问题 I'm trying to use a inputmask on a Yii2 form input. Here is my code: var IDR={"alias":"numeric","prefix":"Rp","digits":0,"digitsOptional":false,"decimalProtect":true,"groupSeparator":",","radixPoint":".","radixFocus":true,"autoGroup":true,"autoUnmask":true,"removeMaskOnSubmit":true}; Inputmask.extendAliases({"IDR": {"alias":"numeric","prefix":"Rp","digits":0,"digitsOptional":false,"decimalProtect":true,"groupSeparator":",","radixPoint":".","radixFocus":true,"autoGroup":true,"autoUnmask":true,

Jquery inputmask casing uppercase/lowercase

↘锁芯ラ 提交于 2019-12-07 07:55:31
Im using jquery inputmask How can I use below code to any input text with out a mask? any letter inputted will force to uppercase. Inputmask.extendAliases({ uppercase: { mask: '' // any letters definitions: { '*': { casing: "upper" // } } }); js $('.uppercase').inputmask({casing:'upper'}); $('.lowercase').inputmask({casing:'lower'}); html <input type="text" class="uppercase" /> <input type="text" class="lowercase" /> .uppercase { text-transform: uppercase; } .lowercase { text-transform: lowercase; } .capitalize { text-transform: capitalize; } <input class="uppercase" /> <input class="lowercase

How to make jquery.inputmask work with input type=number?

人走茶凉 提交于 2019-12-07 04:07:10
问题 I have the code working fine using this plugin as long as the input type=text, but I would like to use type=number so the proper keyboard is shown on mobile devices. Is there a way to do this, hopefully with some setting I have missed in the documentation? Here is my html: <input id="Price" name="Price" type="number" placeholder="0.00" tabindex="3"/> Here is my js: $(document).ready(function(){ $('#Price').inputmask("[9][9]9.99", { numericInput: true, "placeholder": "0", showMaskOnHover:

How to get unmask value in MVC controller

笑着哭i 提交于 2019-12-06 06:27:15
问题 I am using jquery.inputmask.js in my project as $("#SSN").inputmask({ "mask": "999-99-9999", 'autoUnmask': true, onUnMask: function (value) { return value.replace('-', ''); } }); It works fine when displaying. But when i post this model and read the values in controller, it is still giving 999-99-9999 instead of 999999999. I don't want to read each value and replace them as Model.SSN.Replace('-','') before saving. Please help. Thanks!!!! EDIT: When i read $("#SSN").val() in jquery it is

jQuery Input Mask Decimal point

巧了我就是萌 提交于 2019-12-06 05:57:39
I am using the jQuery plugin found at https://github.com/RobinHerbots/jquery.inputmask but I can't seem to be able to derive a pattern that corresponds to a integer & a decimal. For example, I need the following to be valid: 10 150 12.25 0.45 At the moment I am doing: $('#from_id').inputmask("9{0,5}.9{0,2}"); But this means that if the user does not specify what comes after the decimal point, the resulting output is: For example, if the user only wants to input 12 (and he does not specify the decimal point) the output is 12___.__ (as the mask is waiting for the decimal point) But if the user

Jquery.inputmask not working

你。 提交于 2019-12-05 12:40:15
Trying to use Robin Herbots Inputmask module, and can't get it working. Looking at all the other similar posts, a common problem to make sure the docment.ready function has a call to inputmask(), but this looks good to me. Scripts <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"> <script src="/js/jquery.inputmask.js"> <script src="/js/mainReady-client.js"> <script src="/js/bootstrap.min.js"> mainReady-client.js $(document).ready(function() { $(":input").inputmask(); }); HTML <td> <input value="10" data-inputmask="'mask': '999'"> </td> I've tried: $(document)

How to make jquery.inputmask work with input type=number?

主宰稳场 提交于 2019-12-05 09:37:57
I have the code working fine using this plugin as long as the input type=text, but I would like to use type=number so the proper keyboard is shown on mobile devices. Is there a way to do this, hopefully with some setting I have missed in the documentation? Here is my html: <input id="Price" name="Price" type="number" placeholder="0.00" tabindex="3"/> Here is my js: $(document).ready(function(){ $('#Price').inputmask("[9][9]9.99", { numericInput: true, "placeholder": "0", showMaskOnHover: false, greedy: false }); }); scunliffe The jQuery Inputmask plugin ( http://plugins.jquery.com/jquery

jQuery input mask for phone number

不打扰是莪最后的温柔 提交于 2019-12-04 20:32:19
I want a user's input to autofill the punctuation of a phone number in order to look like this (xxx) xxx-xxxx . This is my HTML code: <div class="form-group"> <label class="control-label col-sm-2">Phone Number:</label> <div class="col-sm-10"> <input type="text" class="form-control" name="phoneNumber" id="phoneNumber" value="<?php echo $row["phoneNumber"];?>"> </div> </div> What else do I need to do to complete this task? I am trying to use jQuery and an input mask. You can accomplish this by using the Input Mask jQuery extension. $('#phoneNumber').inputmask("(999) 999-9999"); <script src=