带有小数点的iPhone数字小键盘,用于编辑DIV上的网页应用程序 [英] iPhone Numeric Keypad with Decimal for web apps on a editable DIV

查看:76
本文介绍了带有小数点的iPhone数字小键盘,用于编辑DIV上的网页应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的DOM有一个< div contenteditable =true>

任何人都可以告诉我如何CSS或属性我的容器来获得所需的数字键盘?

解决方案

I认为你应该用下面的代码替换你当前的输入标签

 < input type =numberpattern =[0- 9] */> 

这实际上是告诉iOS(和Android)浏览器使用大数字键盘。

欲了解更多详情,请参阅这里


I built a webapp for mobile.

My DOM has a <div contenteditable="true"> which triggers a keyboard showing up on iOS on touch into the container. So far so good, but in the particular case, I want the user to enter numbers with decimals, so I would like to trigger a numpad with decimal support on iOS (on all mobile broswers later).

Can anyone tell me how to CSS or attribute my container to get the desired numpad?

解决方案

I think you should replace your current input tag with the following one

<input type="number" pattern="[0-9]*" />

That's actually telling iOS (and Android) browser to use the large numpad.

For more details see here.

这篇关于带有小数点的iPhone数字小键盘,用于编辑DIV上的网页应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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