clam2020/public/js/lib/jquery/jquery-validation/src/additional/phoneNL.js

7 lines
323 B
JavaScript
Raw Normal View History

2018-10-05 16:13:30 +00:00
/**
* Dutch phone numbers have 10 digits (or 11 and start with +31).
*/
$.validator.addMethod( "phoneNL", function( value, element ) {
return this.optional( element ) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test( value );
}, "Please specify a valid phone number." );