diff --git a/md-validator.js b/md-validator.js index 12f749b..132deec 100644 --- a/md-validator.js +++ b/md-validator.js @@ -192,7 +192,7 @@ var VALIDATE = new function() { var telNumberErrorNo, telnum = telephoneNumber + ' '; if (telnum.length == 1) { // telNumberErrorNo = 1; - return false; + return ''; } telnum = (telnum).trim(); @@ -200,7 +200,7 @@ var VALIDATE = new function() { var exp = /^(\+)[\s]*(.*)$/; if (exp.test(telnum) == true) { //telNumberErrorNo = 2; - return false; + return ''; } // Remove spaces from the telephone number to help validation @@ -220,14 +220,14 @@ var VALIDATE = new function() { exp = /^[0-9]{10,11}$/; if (exp.test(telnum) != true) { // telNumberErrorNo = 3; - return false; + return ''; } // Now check that the first digit is 0 exp = /^0[0-9]{9,10}$/; if (exp.test(telnum) != true) { // telNumberErrorNo = 4; - return false; + return ''; } // Disallow numbers allocated for dramas. @@ -249,7 +249,7 @@ var VALIDATE = new function() { for (var i = 0; i < tnexp.length; i++) { if (tnexp[i].test(telnum)) { telNumberErrorNo = 5; - return false; + return ''; } } @@ -257,7 +257,7 @@ var VALIDATE = new function() { exp = (/^(01|02|03|05|070|071|072|073|074|075|07624|077|078|079)[0-9]+$/); if (exp.test(telnum) != true) { // telNumberErrorNo = 5; - return false; + return ''; } // Telephone number seems to be valid - return the stripped telehone number