0

The below code is not working Samsung Galaxy S4. I am trying to restrict maxlength(50). Anyone know of a javascript/jquery fix for the Samsung S4?.

enter code here

if (navigator.userAgent.match(/SAMSUNG GALAXY S4/i)) {
$('input[type="text"]').attr("maxlength", 50);
$('input[type="text"]').bind("change keyup", function() {
maxlength = $(this).attr("maxlength");
if ($(this).val().length > maxlength) {
$(this).val($(this).val().slice(0, maxlength));
}              
});
}
yoga
  • 1

0 Answers0