Monday, August 13, 2007

trying to add phone validation ~ .5hr

1. fixed weird 'j' bug on thanks.php page

2. put some regex in for phone. don't know why it doesn't work

function regExPhone(eObj)
{//Uses regular expression for phone check
//strip out acceptable non-numeric characters
var rePattern = strng.replace(/[\(\)\.\-\ ]/g, '');
rePattern = /(^\d{10}$)/;
if(rePattern.test(eObj.value))
{
return true;
}else{
alert("Please enter a valid phone number.");
eObj.value = "";
eObj.focus();
return false;
}
}

No comments: