I have one requirement wherein I have to put a validation check on fax number using Regex.The accepted characters in fax number are + . and numbers from 0 to 9. For this I have written the following javascript function
function validateFax(checkField) {
if (checkField.value.length > 0) {
var faxRegEx = /[+? *[1-9]+]?[0-9 ]+/;
if (!checkField.value.match(faxRegEx)) {
return false;
}
}
return true;
}
but it is not helping me to check all acceptable characters. Moreover it checks only 3 to 4 characters, but my fax number can consist of any number of characters. I am new to Regex. Can any one kindly tell me how can I modify this function to make it aligned to my requirement. Thanks in advance.