Hi All;
Below is my code to format National Insurance number in CRM
but it gives the error as follows
Any help on this is much appreciated
Thanks

function testNINO(myNINO) {
if (checkNINO(myNINO))
return checkNINO(myNINO);debugger;
else
alert("Error:! The NI Number must follow the following format: AA ## ## ## A For example, NE 53 94 02 D");
alert("Error: The NI Number must have the following letter/number combinations:\n\n[A-Z] = e.g. SG\n[0-9] = e.g. 56\n[0-9] = e.g. 01\n[0-9] = e.g. 16\n[A-D] = e.g. B");
}
function checkNINO (toCheck) {
//var exp1 = /^([A-CEGHJ-NOPR-TW-Z]{1}[A-CEGHJ-NPR-TW-Z]{1})([0-9]{2})([0-9]{2})([0-9]{2})([A-Z\s]{1})/i;
var exp1 = /^([A-Z]{1}[A-Z]{1})([0-9]{2})([0-9]{2})([0-9]{2})([A-Z\s]{1})/i;
var exp2 = /(^GB)|(^BG)|(^NK)|(^KN)|(^TN)|(^NT)|(^ZZ).+/i;
//if( !sTmp.match( exp2) )
debugger;
if (toCheck.match(exp1) && !toCheck.match(exp2)) {
var strFormated = toCheck.replace(exp1, "$1 $2 $3 $4 $5");
return strFormated.toUpperCase();
}
else {
return false;
}
}
Pradnya07