我能够在android webview中使用html5输入超过指定的maxlength输入标签和type = text . 当失去焦点/模糊时,值将被修剪为maxlength .
例如
<input type="text" maxlength="5" id="hahaha">
value entered = abcdefghij
on blur/lostfocus value displayed = abcde.
无论如何, restricts the user from entering 字符多于maxlength而不是 trimming content after user entered the content . 在内部监督办公室,它工作正常 .
2 回答
这个问题可能是Android 4.1版本中的一个错误,你可以在这里看到35264 . 你可以用一些Javascript解决这个问题:
或者JQuery:
派对有点晚了,但正如neliojrr所说,你可以使用javascript / jquery来纠正这个问题 . 但是,我很想把它变得更通用: