Hi
Im trying to match up a postal code with a space in it
"[A-Z][0-9][A-Z]\s[0-9][A-Z][0-9]"
It works fine without the space (\s)
Can anyone help, Ive tried so many different ways but still doesnt work
function checkPostal(form){
var CanadianZipPattern="^[A-Z][0-9][A-Z]\s[0-9][A-Z][0-9]$";
var postalRegExp = new RegExp(CanadianZipPattern);
if (postalRegExp.test(form.value) == true )
alert("valid");
else
alert("not");
}
Im trying to match up a postal code with a space in it
"[A-Z][0-9][A-Z]\s[0-9][A-Z][0-9]"
It works fine without the space (\s)
Can anyone help, Ive tried so many different ways but still doesnt work
function checkPostal(form){
var CanadianZipPattern="^[A-Z][0-9][A-Z]\s[0-9][A-Z][0-9]$";
var postalRegExp = new RegExp(CanadianZipPattern);
if (postalRegExp.test(form.value) == true )
alert("valid");
else
alert("not");
}
Comment