How to disable keyboard shortcuts for jQuery date selector?

I had a problem with the jQuery UI date selector, where when manually changing the date and pressing the enter key, the date of the date selection cancels the manual entry (the action I'm going to do is submitting the form).

I would like to disable the keyboard shortcuts in the date selector, but could not find a way.

+3
source share
1 answer

As an option, you can try to override this behavior by assigning another keydown event handler to your input after the date is initialized, and check for an input key

$('#your_input_id').keydown(function(e){
    if(e.which == 13) { 
      $('#your_form_id').submit();
      return false;
    }
});
0
source

Source: https://habr.com/ru/post/1734184/


All Articles