Forum Moderators: open
//my regular expression
//it needs to be either 55555555555 or 5555555555
//no - spaces or ()
var phoneReg = /^([0-9]{9}) ¦ ([0-9]{10})$/;
//if the phone does not match
if (!(phone.match(phoneReg))){
msg += ("Please enter a 9 or 10 digit phone number with no dashes or parenthesis.\n");
return false;
} //else if
alert(msg);
I know this code is getting executed because when I comment
everything out and just type alert("test") it does on the form submit. When I uncomment this
I get nothing when I click the submit button meaning something is wrong with my script. I'm not too familiar with regexs anyone got an idea for me. Thanks