maskedinput

Masked Input Plugin and regular expressions (for decimal numbers)

荒凉一梦 提交于 2019-12-08 06:28:15
问题 I have a text input field in which I want to insert just numbers, then a comma, and then just two decimal digits. I'm trying to obtain this via jQuery, using Masked Input Plugin, but it seems not to work. This is what I have: <input type="text" name="cash" id="number"/> and <script type="text/javascript"> $.mask.definitions['p']='[0-9]+'; $.mask.definitions['d']='[0-9]{2}'; $("#number").mask("p,d"); <script> But the result is a mask with just one digit, then a comma, and then something I'm

Ip Address mask for AngularJS

▼魔方 西西 提交于 2019-12-07 18:14:23
问题 Does Anyone know a ip address mask plugin for AngularJS? Because I tried to use the "Jquery Input IP Address Control", but it's not working. When I try to use it, the "ngModel" attribute doesn't get the value of the textfield. In the screen I can see the value inside the textfield, however, if I do ".value()" in the element, it return a "" value. The same thing occur when I see the value of the $scope element by using console.log(). Can anyone help me? Thanks! Edit: SOLVED People, problem

AjaxControlToolkit MaskedEditExtender - custom mask appearance

对着背影说爱祢 提交于 2019-12-07 09:58:34
问题 I'm using a MaskedEditExtender to show users what format they should use to enter a date into a textbox. How do I change the mask to be dd/MM/yyyy instead of __/__/____ ? 回答1: I looked over the source code for the MaskedEditExtender, and it doesn't look it it supports what you want out of the box. You can replace the '_' with some other character with the PromptCharacter property, but to do what you want, you'd need to edit MaskedEditBehavior.js in the control's source code. Search for

KnockoutJS binding messes with input mask

梦想的初衷 提交于 2019-12-06 12:18:59
问题 I'm trying to apply an input mask to a telephone field. It works until I apply KnockoutJS binding, which removes the mask until the field receives focus. Does not work: http://jsfiddle.net/8r6fe/ $('[data-mask]').each(function () { console.log('mask'); $this = $(this); var mask = $this.attr('data-mask') || 'error...', mask_placeholder = $this.attr('data-mask-placeholder') || 'X'; $this.mask(mask, { placeholder: mask_placeholder }); }) var ViewModel = function() { this.firstName = ko

AjaxControlToolkit MaskedEditExtender - custom mask appearance

烈酒焚心 提交于 2019-12-05 13:42:46
I'm using a MaskedEditExtender to show users what format they should use to enter a date into a textbox. How do I change the mask to be dd/MM/yyyy instead of __/__/____ ? I looked over the source code for the MaskedEditExtender, and it doesn't look it it supports what you want out of the box. You can replace the '_' with some other character with the PromptCharacter property, but to do what you want, you'd need to edit MaskedEditBehavior.js in the control's source code. Search for _PromptChar to find the relevant sections. For a quick workaround, you could create an image of "dd mm yy" and use

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

KnockoutJS binding messes with input mask

守給你的承諾、 提交于 2019-12-04 18:24:18
I'm trying to apply an input mask to a telephone field. It works until I apply KnockoutJS binding, which removes the mask until the field receives focus. Does not work: http://jsfiddle.net/8r6fe/ $('[data-mask]').each(function () { console.log('mask'); $this = $(this); var mask = $this.attr('data-mask') || 'error...', mask_placeholder = $this.attr('data-mask-placeholder') || 'X'; $this.mask(mask, { placeholder: mask_placeholder }); }) var ViewModel = function() { this.firstName = ko.observable(""); this.lastName = ko.observable(""); this.phone = ko.observable(""); this.fullName = ko.computed

Is there masked input plugin for knockout.js using extenders?

若如初见. 提交于 2019-12-02 20:42:12
I've seen this post - it shows one possible solution. But I would like to have a more elegant way of doing masked input. It should also play nicely with knockout validation plugin (or maybe extending it). Anyone know how is there similar project out there? If you wanted to use the excellent Masked Input Plugin in Knockout, it's pretty easy to write a basic custom binding rather than an extender. ko.bindingHandlers.masked = { init: function(element, valueAccessor, allBindingsAccessor) { var mask = allBindingsAccessor().mask || {}; $(element).mask(mask); ko.utils.registerEventHandler(element,

Knockout textInput and maskedinput plugin

泄露秘密 提交于 2019-12-02 14:27:46
问题 Is there an easy way to use data-bind="textInput: aProperty" and add an input mask or some automatic formatting as the user types ? Using the masked input plugin kind of works, but I lose the "as-you-type" updates that Knockout's "textInput:" provides, so other parts of the script only see the change after the field loses focus (effectively behaving as a plain old "value:" binding in Knockout). A naïve solution with a computed observable that does the formatting doesn't work because each

Knockout textInput and maskedinput plugin

 ̄綄美尐妖づ 提交于 2019-12-02 05:00:00
Is there an easy way to use data-bind="textInput: aProperty" and add an input mask or some automatic formatting as the user types ? Using the masked input plugin kind of works, but I lose the "as-you-type" updates that Knockout's "textInput:" provides, so other parts of the script only see the change after the field loses focus (effectively behaving as a plain old "value:" binding in Knockout). A naïve solution with a computed observable that does the formatting doesn't work because each keystroke to a field that updates itself changes the input focus to somewhere else in the page, so the user