V
V
Valeriy19972015-08-28 10:32:56
JavaScript
Valeriy1997, 2015-08-28 10:32:56

How to find error in virtual keyboard script?

Tell me why the input from the virtual keyboard does not work?

Normal input works, but not from the virtual keyboard (

Here is the script itself:

$('.form-control').on('keypress',      function() {
    $('#action').fadeIn(function() {
      $(this).fadeOut();
    });  
  });

  $('.mybutton').on('click', function() {
    var Paste = $(this).data('paste');
    $('.form-control').val($('.form-control').val() + Paste).trigger('keypress');
  });
});


Here is all the code to demonstrate : jsfiddle.net/0xL0fctq/44

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Bolshakov, 2015-08-28
@Valeriy1997

Maybe you should try to subscribe to an element change, and not to a keystroke?

$( "input[type='text']" ).change(function() {
  // Check input( $( this ).val() ) for validity here
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question