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

对着背影说爱祢 提交于 2019-12-23 12:38:44

问题


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:


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>


来源:https://stackoverflow.com/questions/5516705/how-do-you-change-the-return-key-text-in-mobile-safari-keyboard-without-the-form

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!