1

I'm developing a PhoneGap app for iOS. I'm using PhoneGap 3.3.0 and jQuery Mobile.

I need to know if you can show the search button on the phone keyboard and listed to that event.

Thanks in advance for the help.

  • by looking at this http://stackoverflow.com/questions/12297099/is-it-possible-to-add-done-button-inside-the-keyboard-in-iphone its looks doable. As for phonegap, im not sure – Tasos Mar 22 '14 at 08:08
  • I know it can be done using technologies like Titanium, and of course with native XCode, but so far, with PhoneGap, I haven't found any way to do it. –  Mar 23 '14 at 18:35
  • oh, shhht, sorry, was that for Titanium, i thought it was for Phonegap. Let me see if i can find anything else out here – Tasos Mar 23 '14 at 18:38
  • Actually this tutorial is for XCode, native app: http://www.neoos.ch/blog/37-uikeyboardtypenumberpad-and-the-missing-return-key I know is possible on Titanium, but in PhoneGap, I haven't found a post refering to it. –  Mar 23 '14 at 18:40
  • Anyway, I appreciate your help Tasos. If you have any info that you think I might use, I appreciate it. –  Mar 23 '14 at 18:43
  • If theres no solution you can find. An idea is to create your own keyboard and make it look like the IOS one, example -- http://code.tutsplus.com/tutorials/creating-a-keyboard-with-css-and-jquery--net-5774 and then hide the IOS keyboard --- https://github.com/iOffice/SoftKeyboard – Tasos Mar 23 '14 at 19:05

2 Answers2

4

Have you tried something like this?

<form>
    <input type="search" />
</form>

According to this post (Getting Search Keyboard on iPhone using PhoneGap) you need to wrap the input with a form element to get the desired result.

Community
  • 1
  • 1
Dawson Loudon
  • 6,029
  • 2
  • 27
  • 31
  • I just tested this in my current app on an iPod Touch (5th) gen. Without the the form tags I got the normal keyboard. With the form tags I got the search keyboard. – Dawson Loudon Mar 25 '14 at 19:20
  • I will test right now and let you know Dawson. –  Mar 26 '14 at 03:37
  • It works with the form tag surrounding the input type search. Now, the thing is, how do I handle the submit event so it doesn't submit the form, instead, I need it to call a JavaScript function. This is a PhoneGap app. –  Mar 27 '14 at 15:48
  • Already solved it.
    Now I would like to know if after calling the form submit you can hide the keyboard. Any assistance would be welcome. Thanks again.
    –  Mar 27 '14 at 16:04
  • Try adding to `searchForSpotsForTraq()` `$('#newTraqSpotFilter').blur();` – Dawson Loudon Mar 27 '14 at 16:08
0
<input type="search" />

check it with below link too. http://mobiforge.com/design-development/html5-mobile-web-forms-and-input-types

Gopal vaid
  • 376
  • 3
  • 7
  • Without the form that, this does not work. Sorry, and thanks. It seems like you have to surround the tag with a form. –  Mar 27 '14 at 15:47