3

I have an app using a webview running on Android 2.3. (I only need to target 2.3, its for a specific device). My HTML form has the following textbox in it:

<input type="text" maxlength="8" id="blah" name="blah" />

The webview restricts the length to 8, but when the user goes past that the backspace button basically stops functioning, so they can't go back and change what they've typed in. I tried this on my nexus 7 (2013) running the latest version of KitKat and it just completely ignores maxlength altogether. Am I missing something or is there something special you need to do to set the maxlength of a text field in Android?

Ben
  • 16,124
  • 22
  • 77
  • 122
  • I happen to have an Android 2.3 device and [this demo](http://www.w3schools.com/tags/att_input_maxlength.asp) seems to work fine for me, if what you mean is not being able to delete characters using the Backspace Key. – Wei WANG Jan 28 '14 at 03:13
  • This looks like a similar question with a solution: http://stackoverflow.com/questions/11754575/jelly-bean-webview-not-working-well-with-html-maxlength-attribute-for-text-box – JSuar Feb 01 '14 at 03:38

1 Answers1

1

I dont know did you find and try, but when i got the same issue last year i got rid of issue via following:

As you can see in this Project Issue Link this is a common bug and a javascript as recommended on comment can provide a solution for now.

Community
  • 1
  • 1
DortGen
  • 402
  • 2
  • 8
  • 22