android - 电话 : numeric keyboard for text input
<p><p>有没有办法强制数字键盘出现在手机上以获取 <code><input type="text"></code>?我才意识到<a href="http://www.w3.org/TR/html-markup/input.number.html" rel="noreferrer noopener nofollow"><code><input type="number"></code></a> HTML5 中用于“ float ”,因此不适合用于信用卡号、邮政编码等。</p>
<p>我想模拟 <code><input type="number"></code> 的数字键盘功能,用于接受 float 以外的数值的输入。是否有其他合适的 <code>input</code> 类型可以做到这一点?</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>您可以执行 <code><input type="text"pattern="\d*"></code>。这将导致出现数字键盘。</p>
<p>更多详情请看这里:<a href="https://developer.apple.com/library/archive/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html" rel="noreferrer noopener nofollow">Text, Web, and Editing Programming Guide for iOS</a> </p>
<p></p><div class="snippet"data-lang="js"data-hide="false"data-console="true"data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code><form>
<input type="text" pattern="\d*">
<button type="submit">Submit</button>
</form></code></pre>
<p style="font-size: 20px;">关于android - 电话 : numeric keyboard for text input,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/37798748/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/37798748/
</a>
</p>
页:
[1]