有没有办法阻止移动Safari浏览器在HTML表单中插入逗号到许多领域?逗号、没有办法、表单、浏览器

2023-09-08 09:45:15 作者:破茧。

我有一个包含一个表单,允许用户输入信用卡信息的网站。对于卡号,发行数量,CVC号码,他们要存放在HTML形式与类型为数字。

I've got a site that contains a form to allow users to enter credit card details. The fields for the card number, issue number, CVC number and the amount they wish to deposit use an input box in an HTML form with the type "number".

随iOS 5的更新的移动Safari浏览器会自动插入逗号号码号码输入字段。这不仅看起来在CC一些愚蠢的,但它打破了我的验证。有没有办法制止这种?

The updated Mobile Safari that comes with iOS 5 automatically inserts commas into numbers in "number" input fields. This not only looks stupid in a CC number, but it breaks my validation. Is there a way to stop this?

使用,而不是数字的唯一宗旨,以文是使iOS和Android带来了一个数字,只有软键盘,而不是全键盘。

The only purpose of using "number" as opposed to "text" is to make iOS and Android bring up a numbers-only soft keyboard rather than the full keyboard.

我用设置为图案的文本类型的输入尝试[0-9] *。这带来了iOS上,但不是在Android上的数字键盘。它也不允许与一个小数点输入数

I've tried using a "text" type input with a pattern set to "[0-9]*". This brings up the numbers keyboard on iOS but not on Android. It also doesn't allow the number to be entered with a decimal point.

我会很感激的任何建议:)

I'd be very greatful for any suggestions :)

感谢

推荐答案

我是从数量到电话改成我的,我从来没见过的问题出现了。

I changed mine from "number" to "tel" and I've not seen the issue occur anymore.