4

I have this simple HTML file that is to be displayed in a UIWebView.

<html>
<body>
  <p>
  <input name='search' type='search' placeholder="Input type is search" />
</body>
</html>

Here is the screenshot when I clicked the input box.

enter image description here

How to change the Return button to 'Search' like Google page does?

enter image description here

marsant
  • 1,088
  • 13
  • 30

3 Answers3

10

I found a simple solution. Just wrap the input with form tag so the HTML looks like this.

<html>
<body>
  <p>
  <form>
    <input name='search' type='search' placeholder="Input type is search" />
  </form>
</body>
</html>

And now the keyboard looks like

enter image description here

marsant
  • 1,088
  • 13
  • 30
  • 1
    Do you know what the solution is for a textarea? – reectrix Apr 08 '16 at 14:44
  • Is there any way, how to change the label of the "Search" button? For example - we have only suggestions by typing - there is no way how to "search". By pressing "Search" you go to the first suggestion item, which is confusing. – Vojtech Lacina Nov 04 '20 at 06:28
1

Looking in the reference: Text Programming Guide for iOS and I can see that the type search isn't an option, so I think that Safari handle that with a different way. Maybe with a custom inputview. Take a look in my answer to do that.

Community
  • 1
  • 1
dcorbatta
  • 1,893
  • 19
  • 15
-3

You have to select the textfield & in identity inspector you select search shown in pic below :

Gurpreet
  • 181
  • 6