I'm working on a project and i want verify users phone number on my website,but all i found is validate 10 digit phone number,so am confuse because in my country here in nigeria we use 11 digit as our phone number so how can i verify that also.
function phonenumber(inputtxt)
{
var phoneno = /^\+?([0-9]{2})\)?[-. ]?([0-9]{4})[-. ]?([0-9]{4})$/;
if((inputtxt.value.match(phoneno))
{
return true;
}
else
{
alert("message");
return false;
}
}
the code above is only for 10 digit how can i make it for 11 or is their any other way.