Reputation: 1471
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
Reputation: 32354
Use the input
event
$('#txtNumbers').on('input', function () {
if ($(this).val() !== '') {
$('#btnAdd').prop('disabled', false);
}
else {
$('#btnAdd').prop('disabled', true);
}
});
Upvotes: 4