x-editable + maskedinput在输入时返回下划线但未点击

时间:2016-02-16 22:14:52

标签: x-editable maskedinput

x-editable + maskedinput在输入时从maskedinput返回下划线但是当我点击时它不会。关于如何解决这个问题的任何想法?

的jsfiddle:

jQuery Library:

HTML:

<a href="#" data-pk="1">1</a>

JS:

$('a').editable({
    type: 'text',
    name: 'username',
    tpl: '<input type="text" id ="zipiddemo" class="mask form-control input-sm dd" style="padding-right: 24px;">'
});

$(document).on("focus", ".mask", function () {
    $(this).mask("?999");
});

1 个答案:

答案 0 :(得分:0)

<强>的jsfiddle:

<强> HTML:

<a href="#" data-pk="1">1</a>

<强> JS:

$('a').editable({
    type: 'text',
    name: 'username',
    tpl: '<input type="text" id ="zipiddemo" class="mask form-control input-sm dd" style="padding-right: 24px;">',
    display: function(value, response) {
        return false;
    },
    success: function(response, newValue) {
        $(this).html(newValue.replace(/_/g, ''));
    },
});

$(document).on("focus", ".mask", function() {
    $(this).mask("?999");
});