如何在不带form标签的Mobile Safari键盘中更改返回键文本? [英] How do you change the return key text in Mobile Safari keyboard without the form tag?

查看:76
本文介绍了如何在不带form标签的Mobile Safari键盘中更改返回键文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当输入元素聚焦时,我想更改 Mobile Safari 键盘上的返回"按钮文本.我知道您可以这样做:

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>

但是我不想要表单标签,因为搜索是ajaxian(我不想重新加载页面).

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?

推荐答案

嘿,应该想到这一点(同事解决了).只需使用JavaScript取消表单提交即可.例如:

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>

这篇关于如何在不带form标签的Mobile Safari键盘中更改返回键文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆