用于HTML输入表单的iOS键盘中的Go与return按钮

时间:2021-12-28 09:10:11

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

管理用于HTML 表单(在UIWebView中使用)的iOS键盘是众所周知的,即用于电话号码的

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

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?

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

2 个解决方案

#1


15  

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”按钮。因此,如果您之后使用JavaScript访问表单元素,则可以省略标记。

'Go' button:

'去'按钮:

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

用于HTML输入表单的iOS键盘中的Go与return按钮

'return' button:

'返回'按钮:

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

用于HTML输入表单的iOS键盘中的Go与return按钮

#2


7  

The important part is that the form tag has an action property. (action="#" is a noop.)

重要的是form标签有一个action属性。 (action =“#”是noop。)

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

用于HTML输入表单的iOS键盘中的Go与return按钮

<form action="#">
  <input type="text" />
</form>

用于HTML输入表单的iOS键盘中的Go与return按钮

#1


15  

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”按钮。因此,如果您之后使用JavaScript访问表单元素,则可以省略标记。

'Go' button:

'去'按钮:

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

用于HTML输入表单的iOS键盘中的Go与return按钮

'return' button:

'返回'按钮:

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

用于HTML输入表单的iOS键盘中的Go与return按钮

#2


7  

The important part is that the form tag has an action property. (action="#" is a noop.)

重要的是form标签有一个action属性。 (action =“#”是noop。)

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

用于HTML输入表单的iOS键盘中的Go与return按钮

<form action="#">
  <input type="text" />
</form>

用于HTML输入表单的iOS键盘中的Go与return按钮