2016-02-16 32 views
0

x-editable + maskedinput在输入时从maskedinput返回下划线,但当点击时不会返回下划线。有想法该怎么解决这个吗?x-editable + maskedinput在输入时返回下划线但不是在点击

的jsfiddle:

jQuery的图书馆:

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"); 
}); 

回答

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"); 
});