()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ if ($form.find('input[name=emailAddress]').val() == "") { error = true; addError($form.find('input[name=emailAddress]'), getLocalizedMessage('enter-email', language)); } else if (!$form.find('input[name=emailAddress]').val().match(re)) { error = true; addError($form.find('input[name=emailAddress]'), getLocalizedMessage('invalid-email', language)); } else { removeError($form.find('input[name=emailAddress]')); } var phoneFilter = /^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/; if ($form.find('input[name=mainPhone]').val() == "") { error = true; addError($form.find('input[name=busPhone]'), getLocalizedMessage('enter-phone', language)); } else if (($form.find('select[name=country]').val() == "US") | ($form.find('select[name=country]').val() == "CA")) { if (!$form.find('input[name=busPhone]').val().match(phoneFilter)) { error = true; addError($form.find('input[name=busPhone]'), getLocalizedMessage('invalid-phone', language)); } else removeError($form.find('input[name=busPhone]')); } else { removeError($form.find('input[name=busPhone]')); } if ($form.find('select[name=title]').val() == "") { error = true; addError($form.find('select[name=title]'), getLocalizedMessage('select-title', language)); } else { removeError($form.find('select[name=title]')); } if ($form.find('select[name=department1]').val() == "") { error = true; addError($form.find('select[name=department1]'), getLocalizedMessage('select-department', language)); } else { removeError($form.find('select[name=title]')); } zipFilter = /^\d{5}(-\d{4})?$/ canadianPostalCode = /(^\d{5}(-\d{4})?$)|(^[ABCEGHJKLMNPRSTVXY]{1}\d{1}[A-Z]{1} *\d{1}[A-Z]{1}\d{1}$)/i if ($form.find('input[name^=zip]').val() == "") { error = true; addError($form.find('input[name^=zip]'), getLocalizedMessage('enter-zip', language)); } else if ($form.find('select[name=country]').val() == "US") { if (!$form.find('input[name^=zip]').val().match(zipFilter)) { error = true; addError($form.find('input[name^=zip]'), getLocalizedMessage('invalid-zip-5digit', language)); } } else if ($form.find('select[name=country]').val() == "CA") { if (!$form.find('input[name^=zip]').val().match(canadianPostalCode)) { error = true; addError($form.find('input[name^=zip]'), getLocalizedMessage('invalid-zip', language)); } } else { removeError($form.find('input[name^=zip]')); } if ($form.find('select[name=country]').val() == "") { error = true; addError($form.find('select[name=country]'), getLocalizedMessage('select-country', language)); } else { removeError($form.find('select[name=country]')); } if ($form.find('input[name=terms]').length && !$form.find('input[name=terms]').is(':checked')) { error = true; $form.find('input[name=terms]').addClass('form-error'); } else { if ($form.find('input[name=terms]').length && $form.find('input[name=terms]').hasClass('form-error')) { $form.find('input[name=terms]').removeClass('form-error'); } } // set validation results if (error) { return false; } _satellite.track("formSubmitClick"); return true; } catch (processError) { return false; } }