I am trying to validate numeric characters but with no success, actually what I would need to validate is:
min characters (9) max characters (11)
the first character has to be (0) and the rest(0123456789)
see my code below..
if(myValidation.Phone.value.length == 0)
{
alert("Phone is empty");
myValidation.Phone.focus();
return false;
}
var str=myValidation.phone.value
var filter=/^\0\d{9,11}(0123456789)$/i
if (filter.test(str))
{
return true;
}
else
{
alert("phone code please!!");
myValidation.phone.focus();
return false;
}
min characters (9) max characters (11)
the first character has to be (0) and the rest(0123456789)
see my code below..
if(myValidation.Phone.value.length == 0)
{
alert("Phone is empty");
myValidation.Phone.focus();
return false;
}
var str=myValidation.phone.value
var filter=/^\0\d{9,11}(0123456789)$/i
if (filter.test(str))
{
return true;
}
else
{
alert("phone code please!!");
myValidation.phone.focus();
return false;
}