Android ignoring max length
-
We have a issue with an android samsung phone (S22) – we need 3 characters max to be entered into a field (its the first part of a post code so it will be g1 or g44 for example) – this works fine. the text field id is #fieldname1 and its sent to a min length of 2 & a max of 3 – which works on ios/desktop/all devices I can check & test this on – but it ignores the max length on the clients Samsung android based phone
I have googled & there is a know android bug which ignores the max length and allows any amount of characters to be added.
I don’t have access to a device this happens on – but I have videos from the users showing the issue – I also cant replicate it on the Samsung developers lab either (i.e I was trying various Samsung phones to test this on) .
I have found various pieces of javascript which can force this – but I am not familar enough with javscript to know if what I have added is correct – & I also cant check…
Would this work? & can anyone check & test this?$(document).ready(function() { $('#fieldname1').keypress(function() { if ($(this).val().length === $(this).attr('maxlength')) { return false;The page I need help with: [log in to see the link]
The topic ‘Android ignoring max length’ is closed to new replies.