首页 > 解决方案 > 动态输入掩码 - 一个输入的两个掩码

问题描述

有人帮我弄清楚为什么在这里做错了吗?

我的输入字段需要有两个掩码选项:

00000000000-0(- 前 11 个数字)或 000000000000-0(- 前 12 个数字)

这是我的代码:

        $('#' + account).inputmask({
            //mask: ['99999999999-9', '999999999999-9'], (I used this way before, works, but when I put mouse over the field, it automatically change the mask to the bigger one)
            mask: "(99999999999-9)|(99999999999{1}-9)",
            placeholder: '0',
            numericInput: true
        });

标签: javascriptpluginsinput-maskjquery.inputmask

解决方案


推荐阅读