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