2016-11-09 67 views
1

我有几个字段的注册表。如何使用jQuery给电话号码范围?

拥有电话号码字段。我怎样才能给电话号码范围使用jquery

用户应输入10到15位数字范围。

这里是我的代码

<input type="text" maxlength="10" pattern="[0-9]{10}" name="mobileno" 
title="Enter your mobile number" class="form-control1" required placeholder=""> 

感谢

+1

尝试[input mask](http://digitalbush.com/projects/masked-input-plugin/) – guradio

+0

像这样? – kumar

+0

是你在寻找一个允许输入10到15个字符的输入吗? – Hitmands

回答

2

使用,maxlength和输入属性minlength

<input type="text" pattern="[0-9]{10}" name="mobileno" title="Enter your mobile number" class="form-control1" minlength="10" maxlength="15" required placeholder="">