Added readme

This commit is contained in:
Martin Donnelly 2016-03-15 17:05:20 +00:00
parent 6de6eadb64
commit 58b0ede43e

View File

@ -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