In here I want to know how to add these symbols + - ( ) for this validation. Currently this section only accept numbers. I want accept both number and these sysmbols + - ( ) . Here is my code
if (typeof !fields["enterprisemobile"]) {
isValid = false;
var pattern = new RegExp(/^[0-9\b]+$/);
if (!pattern.test(fields["enterprisemobile"])) {
isValid = false;
errors["enterprisemobile"] = "Mobile Number is invalid";
}
}
new RegExp(/^[0-9\b\+\-\(\)]+$/)and that kind of validation would still have efficiency close to 0, since something, like')-9+would be considered valid phone number.