<html> <head> <title>Phone Number Validation</title> <script language="JavaScript"> <!-- function validatePhone(areaCode,prefix,extension) { var phoneNum = new String(areaCode + "-" + prefix + "-" + extension);
var regExpObj = /(ddd)-ddd-dddd/;
if(regExpObj.exec(phoneNum) == null) { alert(phoneNum + " does not contain a valid code!"); } else { alert("Thank you for your order!"); } } // end script--> </script> </head>