Vishal Anand
Vishal Anand

Reputation: 1471

jquery paste event not firing if pasted using context menu in chrome

How to detect paste event, if it is triggered by chrome context menu ? If done using ctrl + V

following works fine.

 $('#txtNumbers').on('keyup paste change', function () {

            if ($(this).val() !== '') {
                $('#btnAdd').prop('disabled', false);
            }
            else {
                $('#btnAdd').prop('disabled', true);
            }
  });

Upvotes: 1

Views: 1408

Answers (1)

madalinivascu
madalinivascu

Reputation: 32354

Use the input event

 $('#txtNumbers').on('input', function () {

            if ($(this).val() !== '') {
                $('#btnAdd').prop('disabled', false);
            }
            else {
                $('#btnAdd').prop('disabled', true);
            }
  });

Upvotes: 4

Related Questions