jQuery-Mask-Plugin
jQuery-Mask-Plugin copied to clipboard
Using virtual keyboard not trigger this plugin
I've made mini virtual keyboard for my project. And when I enter data with that it doesn't masks.
I'm changing input data with .val()
I'm triggering change, keyup, keydown, keypress manually but still it doesn't work.
function keyboard() {
$('[keyboard]').find('num').on('click', function() {
var val = $(this).html();
var ex = $(this).parent().parent().find('[keyboard-callback]').val();
if (val == "sil") $(this).parent().parent().find('[keyboard-callback]').val('');
else $(this).parent().parent().find('[keyboard-callback]').val(ex + val);
$(this).parent().parent().find('[keyboard-callback]').change().keyup().keydown().trigger('keydown.mask').trigger('keypress').trigger('keydown');
});
}
function inputmasks() {
$('[mask-1]').mask("99/99/9999");
$('[mask-tel]').attr('placeholder', "0 (___) ___ __ __")
$('[mask-tel]').mask("0 (999) 999 99 99");
$('[mask-cc]').mask("9999 9999 9999 9999");
$('[mask-my]').mask("99/99");
}
I solved this by triggering input:
$('input').trigger('input');