用于HTML输入表单的iOS键盘中的前往与返回按钮 [英] Go vs. return button in iOS keyboard for HTML input forms

查看:830
本文介绍了用于HTML输入表单的iOS键盘中的前往与返回按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为HTML < input> 窗体管理iOS键盘(在 UIWebView 中使用)是众所周知的, < input type =tel>< / input> 用于电话号码。 https://developer.apple.com/library/ios/文档/ StringsTextFonts /概念/ TextAndWebiPhoneOS /键盘管理/ KeyboardManagement.html



但我想知道键盘的蓝色Go按钮。
有时键盘有一个蓝色的'Go'按钮,有时键盘有一个灰色的返回按钮
是否有机会以编程方式控制此行为?

解决方案

...

如果< input> 标签位于< form> 标签。
因此,如果您之后使用JavaScript访问您的表单元素,您可以省略< form> 标签。



'Go'按钮

 < form action =...方法= ... > 
< input type =text>< / input>
< / form>

$ b

'返回'按钮

 < input type =text>< / input> 


Managing the iOS keyboard for HTML <input> forms (used in UIWebView) is well known, i.e. <input type="tel"></input> for telephone numbers.

https://developer.apple.com/library/ios/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html

But I was wondering about the keyboard's blue 'Go' button. Sometimes the keyboard has a blue 'Go' button, sometimes the keyboard has a gray return button. Is there any opportunity to control this behavior programmatically?

解决方案

Aha...

The 'Go' button is only shown, if the <input> tag is inside a <form> tag. So, if you access your form elements afterwards with i.e. JavaScript, you can omit <form> tags.

'Go' button:

<form action="..." method="...">
   <input type="text"></input>
</form>

'return' button:

<input type="text"></input>

这篇关于用于HTML输入表单的iOS键盘中的前往与返回按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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