Getting Search Keyboard on iPhone using PhoneGap

后端 未结 3 1388
梦如初夏
梦如初夏 2020-12-10 06:31

I have created a search field on a mobile app i am creating via PhoneGap. I\'ve tried using with no luck. I also know that i could get around the visual aspect of the inp

相关标签:
3条回答
  • 2020-12-10 07:12

    The following are supported in mobile safari, and therefore PhoneGap since iPhone OS 3.1

    Text: <input type="text" />

    Telephone: <input type="tel" />

    URL: <input type="url" />

    Email: <input type="email" />

    Zip Code: <input type="text" pattern="[0-9]*" />

    Search is not supported as an input type, and would require considerable native work to make happen in PhoneGap.

    See here for details: https://developer.apple.com/library/content/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html

    0 讨论(0)
  • 2020-12-10 07:22

    Update: The following input type works as expected:

    There are some important things that you have to keep in mind:

    It only works on iPhone OS 3.1 +

    The input tag MUST be inside a tag.

    Also, it is worth noting the following tags as well:

    <!-- display a telephone keypad -->
    <label for="tiTel">Telephone:</label>
    <input type="tel" id="tiTel"/> 
    <br/>
    
    <!-- display a URL keyboard -->
    <label for="tiUrl">URL:</label>
    <input type="url" id="tiUrl"/>
    <br/>
    
    <!-- display an email keyboard -->
    <label for="tiEmail">Email:</label> 
    <input type="email" id="tiEmail"/>
    <br/>
    
    <!-- display a numeric keyboard -->
    <label for="tiZip">Zip Code:</label>
    <input type="text" pattern="[0-9]*" id="tiZip"/>
    <br/>
    
    0 讨论(0)
  • 2020-12-10 07:23

    Use

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

    The <form> is a must.

    (See also http://groups.google.com/group/phonegap/browse_thread/thread/bca19709dbdf2e24/eb312d0607102395?lnk=raot)

    0 讨论(0)
提交回复
热议问题