How do you change the return key text in Mobile Sa

2019-06-28 06:18发布

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?

1条回答
冷血范
2楼-- · 2019-06-28 06:57

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>
查看更多
登录 后发表回答