Registration field PHONE - validation by length

18.03.2019 20:31
#1
vitaly2016
Joomshopping forum user no avatar
Name: Vitaly
14.06.2016
Posts: 27
Quote
Registration field PHONE - validation by length

I use jquery.mask.js for entering client's phone in proper way while registration step.
Plugin does not allow to enter "prohibited" symbols and to enter more symbols than defined by mask:

jQuery("#phone").mask('+38 (ZYY) YYY-YYYY ', {'translation': {
Z: {pattern: /[0-0]/},
Y: {pattern: /[0-9]/}
}
So most users enter correct phone numbers with this mask.
But there is the only one disadvantage with this approach: user can enter less digits than it requires.
In my case, the phone number must consist of 10 digits plus "+38" country prefix.
How can I set PHONE field validation by its length?

 


Copyrights MAXXmarketing GmbH. Alle Rechte vorbehalten
Durch die Nutzung dieser Website stimme ich zu, dass Cookies zur optimalen Gestaltung der Website sowie zur Analyse der Nutzung der Website verwendet werden. Weiterführende Informationen finden Sie hier. OK, einverstanden.