0

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?

Devin Dixon
  • 11,553
  • 24
  • 86
  • 167

2 Answers2

0

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.

AlBeebe
  • 8,101
  • 3
  • 51
  • 65
0

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.

Devin Dixon
  • 11,553
  • 24
  • 86
  • 167