Как: понимание входных масок в microsoft access 2013 — 2020

Supported markup options

data-inputmask attribute

You can also apply an inputmask by using the data-inputmask attribute. In the attribute you specify the options wanted for the inputmask. This gets parsed with $.parseJSON (for the moment), so be sure to use a well-formed json-string without the {}.

<input data-inputmask="'alias': 'date'" />
<input data-inputmask="'mask': '9', 'repeat': 10, 'greedy' : false" />
$(document).ready(function(){
  $(":input").inputmask();
});

data-inputmask-<option> attribute

All options can also be passed through data-attributes.

<input data-inputmask-mask="9" data-inputmask-repeat="10" data-inputmask-greedy="false" />
$(document).ready(function(){
  $(":input").inputmask();
});

Примеры масок ввода

В таблице ниже приведены примеры использования масок ввода.

Обеспечивает ввод значения в виде

В данном случае пользователи должны вводить код города, так как в соответствующем разделе маски (000 в скобках) используется заполнитель 0.

(206) 555-0199( ) 555-0199

В этом случае в области междугородного кода используется местозаполнитель 9, поэтому междугородные коды необязательны. Кроме того, восклицательный знак (!) обусловливает заполнение маски слева направо.

Предоставляется возможность заменить буквами четыре последних цифры телефонного номера в формате США

Обратите внимание на местозаполнитель 0 в области кода города, который делает междугородный код обязательным

Любое положительное или отрицательное число, включающее не более четырех знаков и не имеющее разделителей тысяч и дробной части.

ЗЕЛЕНЫЙ339М3 МАЙ Р 452Б7

Сочетание обязательных (L) и необязательных (?) букв и обязательных цифр (0). Знак «больше» требует вводить все буквы в верхнем регистре. Чтобы использовать маску ввода этого типа, необходимо задать для типа данных поля таблицы значение Текстовый или Поле МЕМО.

Обязательный почтовый индекс и необязательная область четырехзначного расширения.

Сочетание обязательных букв и цифр, все в верхнем регистре. Данный тип маски ввода помогает, например, правильно вводить инвентарные номера или заполнять другие формы складского учета.

Define custom definitions

You can define your own definitions to use in your mask.Start by choosing a masksymbol.

Next define your validator. The validator can be a regular expression or a function.

The return value of a validator can be true, false or a command object.

  • pos : position to insert

  • c : character to insert

  • caret : position of the caret

  • remove : position(s) to remove

    pos or

  • insert : position(s) to add :

    • { pos : position to insert, c : character to insert }
  • refreshFromBuffer :

    • true => refresh validPositions from the complete buffer
    • { start: , end: } => refresh from start to end

Cardinality specifies how many characters are represented and validated for the definition.

The prevalidator option is used to validate the characters before the definition cardinality is reached. (see ‘j’ example)

When you insert or delete characters, they are only shifted when the definition type is the same. This behavior can be overridden by giving a definitionSymbol. (see example x, y, z, which can be used for ip-address masking, the validation is different, but it is allowed to shift the characters between the definitions)

Inputmask.extendDefinitions({'f'{"validator""[0-9\(\)\.\+/ ]","cardinality"1,'prevalidator'null},'g'{"validator"function(chrs,buffer,pos,strict,opts){}"cardinality"1,'prevalidator'null},'j'{    validator"(19|20)\\d{2}",    cardinality4,    prevalidator{ validator"", cardinality1},{ validator"(19|20)", cardinality2},{ validator"(19|20)\\d", cardinality3}},'x'{    validator"",    cardinality1,    definitionSymbol"i"},'y'{validatorfunction(chrs,buffer,pos,strict,opts){var valExp2 =newRegExp("2|");returnvalExp2.test(bufferpos -1+ chrs);},    cardinality1,    definitionSymbol"i"},'z'{validatorfunction(chrs,buffer,pos,strict,opts){var valExp3 =newRegExp("25|2|");returnvalExp3.test(bufferpos -2+ bufferpos -1+ chrs);},    cardinality1,    definitionSymbol"i"}});

Specify a placeholder for a definition.

Defaults can be set as below.

Inputmask.extendDefaults({'autoUnmask'true});Inputmask.extendDefinitions({'A'{    validator"[A-Za-z\u0410-\u044F\u0401\u0451\u00C0-\u00FF\u00B5",    cardinality1,    casing"upper"},'+'{    validator"[0-9A-Za-z\u0410-\u044F\u0401\u0451\u00C0-\u00FF\u00B5",    cardinality1,    casing"upper"}});Inputmask.extendAliases({'Regex'{    mask"r",    greedyfalse,...}});

But if the property is defined within an alias you need to set it for the alias definition.

Inputmask.extendAliases({'numeric'{    allowPlusfalse,    allowMinusfalse}});

However, the preferred way to alter properties for an alias is by creating a new alias which inherits from the default alias definition.

Inputmask.extendAliases({'myNum'{    alias"numeric",    placeholder'',    allowPlusfalse,    allowMinusfalse}});

Once defined, you can call the alias by:

$(selector).inputmask("myNum");

All callbacks are implemented as options. This means that you can set general implementations for the callbacks by setting a default.

Inputmask.extendDefaults({onKeyValidationfunction(key,result){if(!result){alert('Your input is not valid')}}});

Определение пользовательского символа маски

Вы можете определить свои собственные символы для использования в вашей маске. Начните с выбора символа маски.

валидатор(chrs, maskset, pos, strict, opts)

Затем определите свой валидатор. Проверка может быть регулярным выражением или функцией.

Возвращаемое значение валидатор может быть истинным, ложным или объектом.

Опциональные команды

  • pos : позиция для вставки

  • c : символ для вставки

  • caret : позиция каретки

  • remove : позиция (позиции) для удаления

    pos или

  • insert : позиции (позиций) для добавления :

    • { pos : позиция вставки, c : символ для вставки }
  • refreshFromBuffer :

    • true => refresh validPositions from the complete buffer
    • { start: , end: } => refresh from start to end

prevalidator(chrs, maskset, pos, strict, opts)

Опция предварительной проверки используется для проверки символов перед кардинальным определением, которое будет достигнуто. (См ‘J’ пример)

definitionSymbol

При вставке или удалении символов, они смещаются только тогда, когда определение типа является то же самое. Такое поведение может быть отменено, давая definitionSymbol. (См пример х, у, z, который может быть использован для IP-адреса маски, проверка отличается, но допускается сдвиг символов между определениями)

Inputmask.extendDefinitions({
  'f': {  //masksymbol
    "validator": "[0-9\(\)\.\+/ ]",
    "cardinality": 1,
    'prevalidator': null
  },
  'g': {
    "validator": function (chrs, buffer, pos, strict, opts) {
      //do some logic and return true, false, or { "pos": new position, "c": character to place }
    }
    "cardinality": 1,
    'prevalidator': null
  },
  'j': { //basic year
    validator: "(19|20)\\d{2}",
    cardinality: 4,
    prevalidator: 
      { validator: "", cardinality: 1 },
      { validator: "(19|20)", cardinality: 2 },
      { validator: "(19|20)\\d", cardinality: 3 }
    
  },
  'x': {
    validator: "",
    cardinality: 1,
    definitionSymbol: "i" //это позволяет сдвига значениt из других определений, с тем же символом маски или определения символа
  },
  'y': {
    validator: function (chrs, buffer, pos, strict, opts) {
      var valExp2 = new RegExp("2|");
      return valExp2.test(bufferpos - 1 + chrs);
    },
    cardinality: 1,
    definitionSymbol: "i"
  },
  'z': {
    validator: function (chrs, buffer, pos, strict, opts) {
      var valExp3 = new RegExp("25|2|");
      return valExp3.test(bufferpos - 2 + bufferpos - 1 + chrs);
    },
    cardinality: 1,
    definitionSymbol: "i"
  }
});

set defaults

Значения по умолчанию могут быть установлены, как показано ниже.

Inputmask.extendDefaults({
  'autoUnmask': true
});
Inputmask.extendDefinitions({
  'A': {
    validator: "",
    cardinality: 1,
    casing: "upper" //автоматический перевод в верхний регистр
  },
  '+': {
    validator: "",
    cardinality: 1,
    casing: "upper"
  }
});
Inputmask.extendAliases({
  'Regex': {
    mask: "r",
    greedy: false,
    ...
  }
});

Но если свойство определяется в качестве псевдонима необходимо установить его для определения псевдонима.

Inputmask.extendAliases({
  'numeric': {
    allowPlus: false,
    allowMinus: false
  }
});

Тем не менее, предпочтительный способ, чтобы изменить свойства псевдонима путем создания нового псевдонима, который наследуется из определения псевдонима по умолчанию.

Inputmask.extendAliases({
  'myNum': {
    alias: "numeric",
    placeholder: '',
    allowPlus: false,
    allowMinus: false
  }
});

После того, как определено, вы можете вызвать псевдоним с помощью:

$(selector).inputmask("myNum");

Все обратные вызовы реализованы в виде опций. Это означает, что вы можете установить общие для реализации обратных вызовов путем установки по умолчанию.

Inputmask.extendDefaults({
  onKeyValidation: function(key, result){
    if (!result){
      alert('Ваше введенное значение не верно')
    }
  }
});

Воспользоваться Intercepter-NG

Неплохой способ вспомнить пароль – прибегнуть к помощи особой утилиты Intercepter-NG. Несмотря на то, что она скорее предназначена для хакеров, можно её преимущества использовать для решения этой проблемы.

После входа в любой аккаунт или программу, как только произойдёт автоматическая авторизация, Intercepter-NG сделает своё дело – обнаружит сведения для входа и зафиксирует информацию в отдельном текстовом файле. Останется открыть этот отчёт и увидеть логин с паролем для входа на конкретный сайт или в приложение. Надо добавить, что корректная работа этой программы возможна только на смартфонах с включёнными рут правами.

Выполнить функцию после завершения ввода

Плагин также может выполнить функцию после завершения ввода:

$("#phone").mask("+7 (999) 999 - 9999",{completed:function(){alert("ОК!");}});

Маска ввода в полях формы на jQuery

Оригинал статьи Маска ввода в полях формы на jQuery

Masked input — очередной плагин предназначенный для всеми горячо любимого javascript фремворка jQuery, он позволяет облегчить жизнь вам и вашим пользователям, тем что с его помощью можно установить строгий формат ввода (маску ввода) в текстовые поля формы что хорошо подойдет для ввода времени, даты, телефона и т.п.

Плагин корректно работает во всех браузерах начитаная с IE6 +, FF 1.5 +, Opera, Safari, Chrome.

И так, что же нужно сделать для того, что бы начать использовать данный плагин на своем сайте? Для начала подключите javascript файлы jQuery и плагина к вашей странице, выглядеть это будет примерно так:

<script src="jquery.js" type="text/javascript"></script>
<script src="jquery.maskedinput.js" type="text/javascript"></script>

Далее нужно вызвать функцию плагина для всех элементов формы для которых надо создать маску, и передать в нее необходимые параметры:

jQuery(function($){
   $("#date").mask("99/99/9999");
   $("#phone").mask("(999) 999-9999");
   $("#tin").mask("99-9999999");
   $("#ssn").mask("999-99-9999");
});

Функция плагина принимает 2 параметра первый — сама маска для ввода, второй — объект дополнительных параметров. Маска ввода представляет из себя строку состоящую из спец символов:

a — трактуется как буквенный символ из диапазона (A-Z,a-z)
9 — трактуется как числовой символ (0-9)
* — трактуется как алфавитно цифровой символ (A-Z,a-z,0-9)

Все символы кроме перечисленных выше трактуются как литералы.

В объекте дополнительных параметров можно указать заполнитель маски ввода, по умолчанию он равен _, к примеру вы захотели изменить его на пробел, тогда ваш код вызова функции плагина будет выглядеть примерно так:

jQuery(function($){
   $("#product").mask("99/99/9999",{placeholder:" "});
});

Так же в качестве дополнительного параметра можно указать функцию обратного вызова, которая будет вызвана после того как все элементы маски будут заполнены, например:

jQuery(function($){
   $("#product").mask("99/99/9999",{completed : function(){
       alert("Вы ввели: "+this.val());}
   });
});
Вы мож

ете использовать свои определения для спецсимволов маски ввода к примеру, вы хотите что бы пользователь мог указывать разность или сумму чисел тогда вы можете сделать это следующим образом:

jQuery(function($){
   $.mask.definitions='';
   $("#eyescript").mask("~9.99 ~9.99 999");
});

Иногда бывают такие ситуации, что возникает потребность не заполнять пользователем некоторую часть маски ввода, для этого вы можете использовать спецсимвол ? — все что идет после этого символа является не обязательным для ввода с стороны пользователя, например:

jQuery(function($){
   $("#phone").mask("(999) 999-9999? x99999");
});

Вот это наверное и все основные возможности данного плагина, используйте его в своих проектах и вы сделаете жизнь неопытного пользователя маленечко проще 🙂

Experimental ?

The following props are considered experimental because they are more prone to issues and are likely to be changed in the future. Use with caution.

In case you need to implement more complex masking behavior, you can provide function to change masked value and cursor position before it will be applied to the input. receives following arguments:

  1. newState (object): New input state. Contains and fields. is null on input blur or when function is called before input mount. Example:
  2. oldState (object): Input state before change. Contains and fields. is null on input focus or when function is called before input mount.
  3. userInput (string): Raw entered or pasted string. if user didn’t enter anything (e.g. triggered by deletion or rerender due to props change).
  4. maskOptions (object): Mask options. Example:
{  mask'99/99/9999',  maskChar'_',  alwaysShowMaskfalse,  formatChars{'9''','a''','*'''},  permanents2,5}

must return an object with following fields:

  1. value (string): New value.
  2. selection (object): New selection. If in argument is null, it must be null too.

Please note that executes more often than and must be pure.

To use another component instead of regular pass render function as a children. Function receives argument which contains props that aren’t used by react-input-mask’s internals. I.e. it passes down every prop except the following ones: , , , , , , , . These properties, if used, should always be passed directly to react-input-mask instead of children and shouldn’t be altered in chldren’s function.

import React from'react';import InputMask from'react-input-mask';import MaterialInput from'@material-ui/core/Input';constInput=(props)=>(<InputMaskmask="99/99/9999"value={props.value}onChange={props.onChange}>{(inputProps)=><MaterialInput{...inputProps}type="tel"disableUnderline/>}</InputMask>);constInvalidInput=(props)=>(<InputMaskmask="99/99/9999"value={props.value}>{(inputProps)=><MaterialInput{...inputProps}type="tel"disableUnderlineonChange={props.onChange}/>}</InputMask>);
import React from'react';import InputMask from'react-input-mask';classPhoneInputextendsReact.Component{render(){return<InputMask{...this.props}mask="+4\9 99 999 99"maskChar=""/>;}}

Mask for ZIP Code. Uses beforeMaskedValueChange to omit trailing minus if it wasn’t entered by user:

import React from'react';import InputMask from'react-input-mask';classInputextendsReact.Component{  state ={    value''}onChange=(event)=>{this.setState({      valueevent.target.value});}beforeMaskedValueChange=(newState,oldState,userInput)=>{var{ value }= newState;var selection =newState.selection;var cursorPosition = selection ?selection.startnull;if(value.endsWith('-')&& userInput !=='-'&&!this.state.value.endsWith('-')){if(cursorPosition ===value.length){        cursorPosition--;        selection ={ start cursorPosition, end cursorPosition };}      value =value.slice(,-1);}return{      value,      selection};}render(){return<InputMaskmask="99999-9999"maskChar={null}value={this.state.value}onChange={this.onChange}beforeMaskedValueChange={this.beforeMaskedValueChange}/>;}}

Browser’s autofill requires either empty value in input or value which exactly matches beginning of the autofilled value. I.e. autofilled value «+1 (555) 123-4567» will work with «+1» or «+1 (5», but won’t work with «+1 (___) ___-____» or «1 (555)». There are several possible solutions:

  1. Set to null and trim space after «+1» with if no more digits are entered.
  2. Apply mask only if value is not empty. In general, this is the most reliable solution because we can’t be sure about formatting in autofilled value.
  3. Use less formatting in the mask.

Please note that it might lead to worse user experience (should I enter +1 if input is empty?). You should choose what’s more important to your users — smooth typing experience or autofill. Phone and ZIP code inputs are very likely to be autofilled and it’s a good idea to care about it, while security confirmation code in two-factor authorization shouldn’t care about autofill at all.

Alias definitions

date aliases

$(document).ready(function(){
   $("#date").inputmask("dd/mm/yyyy");
   $("#date").inputmask("mm/dd/yyyy");
   $("#date").inputmask("date"); // alias for dd/mm/yyyy
});

The date aliases take leapyears into account. There is also autocompletion on day, month, year.
For example:

input: 2/2/2012 result: 02/02/2012
input: 352012 result: 03/05/2012
input: 3530 result: 03/05/2030
input: rightarrow result: the date from today

numeric aliases

$(document).ready(function(){
   $("#numeric").inputmask("decimal");
   $("#numeric").inputmask("non-negative-decimal");
   $("#numeric").inputmask("integer");
});

There is autocompletion on tab with decimal numbers.

Define the radixpoint

$(document).ready(function(){
   $("#numeric").inputmask("decimal", { radixPoint: "," });
});

Define the number of digits after the radixpoint

$(document).ready(function(){
   $("#numeric").inputmask("decimal", { digits: 3 });
});

Grouping support through: autoGroup, groupSeparator, groupSize

$(document).ready(function(){
   $("#numeric").inputmask("decimal", { radixPoint: ",", autoGroup: true, groupSeparator: ".", groupSize: 3 });
});

Способ второй: переводим проценты в десятичную дробь

Как вы помните, процент — сотая часть числа. В виде десятичной дроби это 0,01 (ноль целых одна сотовая). Следовательно, 17% – это 0,17 (ноль целых, семнадцать сотых), 45% – 0,45 (ноль целых, сорок пять сотых) и т. д. Полученную десятичную дробь умножаем на сумму, процент от которой считаем. И находим искомый ответ.

Например, давайте рассчитаем сумму подоходного налога от зарплаты 35 000 рублей. Налог составляет 13%. В виде десятичной дроби это будет 0,13 (ноль целых, тринадцать сотых). Умножим сумму 35 000 на 0,13. Получится 4 550. Значит, после вычета подоходного налога вам будет перечислена зарплата 35 000 – 4 550 = 30 050. Иногда эту сумму уже без налога называют «зарплатой на руки» или «чистой». В противовес этому сумму вместе с налогом «грязной зарплатой». Именно «грязную зарплату» указывают в объявлениях о вакансиях компании и в трудовом договоре. На руки же даётся меньше. Сколько? Теперь вы легко посчитаете.

Supported markup options

data-inputmask attribute

You can also apply an inputmask by using the data-inputmask attribute. In the attribute you specify the options wanted for the inputmask. This gets parsed with $.parseJSON (for the moment), so be sure to use a well-formed json-string without the {}.

<input data-inputmask="'alias': 'date'" />
<input data-inputmask="'mask': '9', 'repeat': 10, 'greedy' : false" />
$(document).ready(function(){
  $(":input").inputmask();
});

data-inputmask-<option> attribute

All options can also be passed through data-attributes.

<input data-inputmask-mask="9" data-inputmask-repeat="10" data-inputmask-greedy="false" />
$(document).ready(function(){
  $(":input").inputmask();
});

Usage

Simply include

<script src="cleave.min.js"></script>
<script src="cleave-phone.{country}.js"></script>

Then have a text field

<input class="input-phone" type="text"/>

Now in your JavaScript

var cleave = new Cleave('.input-phone', {
    phone: true,
    phoneRegionCode: '{country}'
});

CommonJS

var Cleave = require('cleave.js');
require('cleave.js/dist/addons/cleave-phone.{country}');

var cleave = new Cleave(...)

AMD

require('cleave.js/dist/cleave.min', 'cleave.js/dist/addons/cleave-phone.{country}', function (Cleave) {
    var cleave = new Cleave(...)
});

ES Module

// Rollup, WebPack
import Cleave from 'cleave.js';
var cleave = new Cleave(...)

// Browser
import Cleave from 'node_modules/cleave.js/dist/cleave-esm.min.js';
var cleave = new Cleave(...)

TypeScript

Types are contributed by the community and are available via . Once installed, you can import Cleave like the following:

import Cleave = require('cleave.js');

Types for the React-component are also available and can be imported in the same way.

import Cleave = require('cleave.js/react');

Property Details

$_hashVar
protected property

The hashed variable to store the pluginOptions

protected string = null

$aliases
public property

Custom aliases to use. Should be configured as , where

  • is a string containing a text to identify your mask alias definition (e.g. ‘phone’) and
  • is an array containing settings for the mask symbol, exactly similar to parameters as passed in .

public array = null

$clientOptions
public property

The JQuery plugin options for the input mask plugin.

See also https://github.com/RobinHerbots/Inputmask.

public array = []

$definitions
public property

Custom mask definitions to use. Should be configured as , where

  • is a string, containing a character to identify your mask definition and
  • is an array, consisting of the following entries:

    • : string, a JS regular expression or a JS function.
    • : int, specifies how many characters are represented and validated for the definition.
    • : array, validate the characters before the definition cardinality is reached.
    • : string, allows shifting values from other definitions, with this .

public array = null

$mask
public property

The input mask (e.g. ’99/99/9999′ for date input). The following characters
can be used in the mask and are predefined:

  • : represents an alpha character (A-Z, a-z)
  • : represents a numeric character (0-9)
  • : represents an alphanumeric character (A-Z, a-z, 0-9)
  • and : anything entered between the square brackets is considered optional user input. This is
    based on the setting in .

Additional definitions can be set through the property.

public string|array|yii\web\JsExpression = null

$options
public property

The HTML attributes for the input tag.

See also for details on how attributes are being rendered.

public array = [‘class’ => ‘form-control’

$type
public property
(available since version 2.0.6)

The type of the input tag. Currently only ‘text’ and ‘tel’ are supported.

See also https://github.com/RobinHerbots/Inputmask.

public string = ‘text’

Property Details

$_hashVar
protected property

The hashed variable to store the pluginOptions

protected string = null

$aliases
public property

Custom aliases to use. Should be configured as , where

  • is a string containing a text to identify your mask alias definition (e.g. ‘phone’) and
  • is an array containing settings for the mask symbol, exactly similar to parameters as passed in .

public array = null

$clientOptions
public property

The JQuery plugin options for the input mask plugin.

See also https://github.com/RobinHerbots/Inputmask.

public array = []

$definitions
public property

Custom mask definitions to use. Should be configured as , where

  • is a string, containing a character to identify your mask definition and
  • is an array, consisting of the following entries:

    • : string, a JS regular expression or a JS function.
    • : int, specifies how many characters are represented and validated for the definition.
    • : array, validate the characters before the definition cardinality is reached.
    • : string, allows shifting values from other definitions, with this .

public array = null

$mask
public property

The input mask (e.g. ’99/99/9999′ for date input). The following characters
can be used in the mask and are predefined:

  • : represents an alpha character (A-Z, a-z)
  • : represents a numeric character (0-9)
  • : represents an alphanumeric character (A-Z, a-z, 0-9)
  • and : anything entered between the square brackets is considered optional user input. This is
    based on the setting in .

Additional definitions can be set through the property.

public string|array|yii\web\JsExpression = null

$options
public property

The HTML attributes for the input tag.

See also for details on how attributes are being rendered.

public array = [‘class’ => ‘form-control’

$type
public property
(available since version 2.0.6)

The type of the input tag. Currently only ‘text’ and ‘tel’ are supported.

See also https://github.com/RobinHerbots/Inputmask.

public string = ‘text’

numeric extensions

$(document).ready(function(){
   $("#numeric").inputmask("decimal");
   $("#numeric").inputmask("decimal", { allowMinus: false });
   $("#numeric").inputmask("integer");
});

RadixDance

With the decimal mask the caret will always jump to the integer part, until you type the radixpoint.
There is autocompletion on tab with decimal numbers. You can disable this behaviour by setting the skipRadixDance to true.

Define the radixpoint

$(document).ready(function(){
   $("#numeric").inputmask("decimal", { radixPoint: "," });
});

Define the number of digits after the radixpoint

$(document).ready(function(){
   $("#numeric").inputmask("decimal", { digits: 3 });
});

When TAB out of the input the digits autocomplate with 0 if the digits option is given a valid number.

Grouping support through: autoGroup, groupSeparator, groupSize

$(document).ready(function(){
   $("#numeric").inputmask("decimal", { radixPoint: ",", autoGroup: true, groupSeparator: ".", groupSize: 3 });
});

Allow minus and/or plus symbol

$(document).ready(function(){
   $("#numeric").inputmask("decimal", { allowMinus: false });
   $("#numeric").inputmask("integer", { allowMinus: false, allowPlus: true });
});

Supported markup options

<inputid="test"dir="rtl" />
<inputid="test"readonly="readonly" />
<inputid="test"disabled="disabled" />
<inputid="test"maxlength="4" />

You can also apply an inputmask by using the data-inputmask attribute. In the attribute you specify the options wanted for the inputmask. This gets parsed with $.parseJSON (for the moment), so be sure to use a well-formed json-string without the {}.

<inputdata-inputmask="'alias': 'date'" /><inputdata-inputmask="'mask': '9', 'repeat': 10, 'greedy' : false" />
$(document).ready(function(){$(":input").inputmask();});

All options can also be passed through data-attributes.

<inputdata-inputmask-mask="9"data-inputmask-repeat="10"data-inputmask-greedy="false" />
$(document).ready(function(){$(":input").inputmask();});
Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Adblock
detector