jQuery-Mask-Plugin icon indicating copy to clipboard operation
jQuery-Mask-Plugin copied to clipboard

Using virtual keyboard not trigger this plugin

Open erenbertr opened this issue 9 years ago • 1 comments

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

erenbertr avatar Feb 22 '17 13:02 erenbertr

I solved this by triggering input:

$('input').trigger('input');

erenbertr avatar Mar 24 '17 11:03 erenbertr