开发者

IPad Disable keyevent on input

I am working on a solution that implements adding text to textboxes but I disable the normal key events and use a custom one. I disable the key event like this:

<input onkeypress="return false;"  onkeydown="return false;"  onkeyup="return false;" type="text">

Now this works fine on browsers(Safari, Firefox, IE) but it fails to do so on the IPad's Safari and when a 开发者_开发百科user press a key, it is entered twice. Is there another way to disable key events on the input field for the ipad?


Maybe you can make the textbox completely transparent (alpha:0), place it inside a div, and add the text to the div behind the textbox.


I figured it out. Basically if you are going to customize key entry, you have to customize it on the key up and not the key down or key pressed in Javascript.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜