Mahmoud Fayez
Mahmoud Fayez

Reputation: 3459

hide iPad keyboard

I have UIWebview instance which has a form that the user will fill-in. I need him to fill-in it with hex values.

so I made a custom keyboard layout following jQuery on screen keyboard library found here http://mottie.github.com/Keyboard/

and modified it to work on tablets.

The problem now is that the iPad keyboard still pops up but I managed to ignore the keys when pressed. any better idea to fully hide it?

Upvotes: 1

Views: 2454

Answers (1)

Mahmoud Fayez
Mahmoud Fayez

Reputation: 3459

I found how to do it

Using jQuery blur elements on touchdown event.

You need to add this code to the document ready function:

$('input[type="text"]').bind('touchstart', function(e) {
    e.preventDefault();
    document.activeElement.blur();
});

Upvotes: 1

Related Questions