我们如何才能修正数字模式 [英] how we can correct pattern for digits only
本文介绍了我们如何才能修正数字模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在此字段中,我们只能输入数字
In this field we can enter only digits
我的代码是
my code is
<input name="issue_bal" id="issue_bal"
type="text" required="required"
pattern="[0-9]" tabindex="1"
class="limiter mid"/>
但这不起作用。
but this is not working.
推荐答案
您的模式仅描述 1 数字,而不是多个。为了验证一位或多位数字,请使用以下模式:
Your pattern only describes 1 digit, not multiple. In order to validate 1 or more digits use the following pattern:
pattern="[0-9]+"
这篇关于我们如何才能修正数字模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文