By form submit using "jQuery validator" for input field validation. I want to validator phone number its working fine but that problem is phone number must start with '+'.
So I am using RegEx
/\+[91][0-9]{10}/
my jQuery rules is
$("#commentForm").validate({
rules: {
phoneNumber: {
matches: "/\+[91][0-9]{10}/",
required: true,
minlength: 10,
maxlength: 10,
number: true
}
}
});
That above code is not working, is its correct for add matches field RegEx to jQuery validator