三星Galaxy平板电脑不允许进入浮点数来输入,"数量"类型 [英] Samsung Galaxy Tablet does not allow entering floating point numbers to inputs with "number" type

查看:184
本文介绍了三星Galaxy平板电脑不允许进入浮点数来输入,"数量"类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的客户希望我们能够对输入字段中显示的数字键盘所以基本上我创建了一个领域,如:

Our client wants us to display numeric keyboard for an input field so basically I created a field like:

<输入类型=数字NAME =量的步骤=01值=0.00/>

不过,银河平板抹去。并合并号之前和之后,也将禁用。在键盘。

However, Galaxy Tablet erases "." and merges numbers before and after it, also disables "." in the keyboard.

有另一种方式来解决这个问题,或者在使用类型=文本显示的数字键盘输入字段?

Is there another way to solve this issue or display numeric keyboard in input field when using type="text"?

请注意: 我试图用模式属性(适用于iPhone)。 我与Android 2.1+各种Android设备上测试了这个问题。我没有遇到任何其他HTC和三星的设备此错误。

Note: I tried using pattern attribute (which works on iPhone). I tested this issue on various Android devices with Android 2.1+. I did not encounter this error on any other HTC and Samsung devices.

推荐答案

是的,还有另一种方式。

Yes, there is another way.

  1. 方法1:不使用 TYPE =号,但使用 TYPE =文本
  2. 方法2:申请方式1只Android手机。检测用户代理等。
  3. 方法3:只破实施应用方式1。参见:<一href="http://stackoverflow.com/questions/23205511/what-models-of-samsung-smartphones-do-not-support-html5-input-type-number">What三星的智能手机型号不支持HTML5输入类型=&QUOT;数量和QUOT;?
  4. 路4:使用 TYPE =电话只有Android或折断。 (不能在iPhone上使用,因为没有时间的话)
  5. 路5:使用 TYPE =文本,然后用JavaScript的自定义行为。参见:
  1. Way 1: don't use type="number" but use type="text"
  2. Way 2: Apply way 1 for only Android phones. Detect User-Agent etc.
  3. Way 3: Apply way 1 for only broken implementations. See: What models of Samsung smartphones do not support html5 input type="number"?
  4. Way 4: Use type="tel"' for only Android or broken. (can't use on iPhone as no period then)
  5. Way 5: use type="text" and then javascript with custom behavior. See:

期总是显示: http://jsbin.com/heqeduyi/1/

周期显示,一旦3个数字: http://jsbin.com/yinaweho/1

Period shows once 3 digits: http://jsbin.com/yinaweho/1

这篇关于三星Galaxy平板电脑不允许进入浮点数来输入,&QUOT;数量&QUOT;类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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