I am using maxlength in my Cordova based Android App. I have implemented maxlength using this code-
$('.limit-eight').keyup(function(e) {
if (e.keyCode != 8 || e.keyCode != 46) {
if ($(this).val().length >= 8) {
$(this).val($(this).val().substr(0, 8));
}
}
});
but whenever user copies and pastes, text pastes as it is without restriction.