【问题标题】:cannot paste number into kendo masked input unless the mask is selected first除非首先选择掩码,否则无法将数字粘贴到剑道掩码输入中
【发布时间】:2017-03-12 17:55:44
【问题描述】:

这里有两个例子。我的小提琴,除非首先选择掩码,否则粘贴 10 位数字不起作用,然后是一个工作示例,可以在不首先选择掩码的情况下粘贴电话号码。我必须怎么做才能让 10 位数字以相同的方式粘贴到我的小提琴中?

如果要粘贴 0123456789 ,必须首先选择掩码: https://jsfiddle.net/o819awpa/

 <input id="tendigit" maxlength="10" />


$(document).ready(function () {

        $("#tendigit").kendoMaskedTextBox({
                mask: "0000000000"                    
            });

});

工作示例,您无需先选择掩码即可粘贴 212-555-9999:

http://demos.telerik.com/kendo-ui/maskedtextbox/index

【问题讨论】:

    标签: kendo-ui maskedinput


    【解决方案1】:

    您需要删除 maxlength="10" 属性。这导致了这个问题,正是我没有确定的原因。这样做不会丢失任何内容,因为掩码将确保不超过长度。

    【讨论】:

      猜你喜欢
      • 2020-12-17
      • 1970-01-01
      • 2021-09-28
      • 2017-06-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-15
      • 2019-04-16
      相关资源
      最近更新 更多