1

I have registration form with few fields.

Having phone number field. How can i give phone number range using jquery.

User should enter between 10 to 15 digits range.

Here is my code

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

Thanks

Lelio Faieta
  • 6,457
  • 7
  • 40
  • 74
kumar
  • 147
  • 5
  • 15

1 Answers1

2

Use, maxlength and minlength in input attribute.

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