Search code examples
keyboardvirtualmobile-safarireturnenter

How do you change the return key text in Mobile Safari keyboard without the form tag?


I would like to change the the "return" button text on the Mobile Safari keyboard when my input element is focused. I know you can do this:

<form action="somewebsite.com">
  <input id='SearchTextBox' type="search"/>
  <input id='SearchButton' type="button" value="Search" />  
</form>

But I don't want the form tag because the search is ajaxian (I don't want to reload the page).

Does anyone know if this is possible?


Solution

  • Heh, should have thought of this (coworker solved). Just cancel the form submission with JavaScript. For example:

    <form action="#" onsubmit="return false;">
      <input id='SearchTextBox' type="search"/>
      <input id='SearchButton' type="button" value="Search" />  
    </form>