0

I am working on phone Gap application in which i am using my custom jquery keyboard but when i focus on the input the native keyboard of device is open. I did't have knowledge of objective-C so please can u help me to prevent the native keyboard on ios device when i click on the text field.

I am trying to do but it's work only for one time when i double click on the input field the application is crashed.

my code is..

// register for keyboard show event
    [[NSNotificationCenter defaultCenter]
     addObserver:self
     selector:@selector(keyboardWillShow:)
     name:UIKeyboardWillShowNotification
     object:nil];
 // hiding UIWebviewAccessary
// http://ios-blog.co.uk/iphone-development-tutorials/rich-text-editing-a-simple-start-part-1/

- (void)keyboardWillShow:(NSNotification *)note {
    [self.view endEditing:YES];
    [self removeBar];
    [self performSelector:@selector(adjustFrame) withObject:nil afterDelay:0.03];
}

- (void)adjustFrame {
    [self.webView stringByEvaluatingJavaScriptFromString:@"window.scroll(0,0)"];
} 
user2075328
  • 423
  • 2
  • 7
  • 16

1 Answers1

0

You can use below

// automatically close the keyboard on iOS
 document.activeElement.blur();

But i thinks u want to close keyboard when your input Focus().

also use ..

var hideKeyboard = function() {
document.activeElement.blur();
$("input").blur();
};
Darshan
  • 2,272
  • 3
  • 31
  • 43
  • Yes it work but i want to hide the keyboard using native code because if we use blur() function than i am not able to open my custom keyboard because it's also open on focus event. – user2075328 Dec 16 '13 at 12:13