var validations = new Array(); validations[0] = new Validation("reg_user_FirstName", "", "Alpha", "Y", 50, "", "", "Value is required.", "") validations[1] = new Validation("reg_user_LastName", "", "Alpha", "Y", 25, "", "", "Value is required.", "") validations[2] = new Validation("reg_user_Address1", "", "", "Y", 40, "", "", "", "") validations[3] = new Validation("reg_user_Address2", "", "", "", 40, "", "", "", "") validations[4] = new Validation("reg_user_EmailAddress", "", "Email", "Y", 70, "", "", "", "") validations[5] = new Validation("reg_user_ConfirmEmail", "", "", "Y", "", "", "", "", "ValidateConfirmEmail") validations[6] = new Validation("reg_user_City", "", "", "Y", 40, "", "", "", "") validations[7] = new Validation("reg_user_Title", "", "MultiSelect", "Y", "", "", "", "", "") validations[8] = new Validation("reg_user_State", "", "MultiSelect", "Y", "", "", "", "", "") validations[9] = new Validation("reg_user_Zip", "", "Numeric", "Y", 5, 5, "", "", "") validations[10] = new Validation("reg_user_HomePhone", "", "", "", "", "", "^\(\d{3}\) ?\d{3}( |-)?\d{4}|^\d{3}( |-)?\d{3}( |-)?\d{4}", "", "") validations[11] = new Validation("reg_user_FaxPhone", "", "", "", "", "", "^\(\d{3}\) ?\d{3}( |-)?\d{4}|^\d{3}( |-)?\d{3}( |-)?\d{4}", "", "") validations[12] = new Validation("reg_user_DOBMonth", "", "Numeric", "Y", 2, "", "", "", "") validations[13] = new Validation("reg_user_DOBDay", "", "Numeric", "Y", 2, "", "", "", "") validations[14] = new Validation("reg_user_DOBYear", "", "Numeric", "Y", 4, "", "", "", "") validations[15] = new Validation("reg_survey_2", "", "Radio", "Y", "", "", "", "", "") function ValidateConfirmEmail() { var emailID = document.getElementById("reg_user_EmailAddress"); var confirmID = document.getElementById("reg_user_ConfirmEmail"); if (confirmID && emailID) { if (emailID.value !="" || confirmID.value != "") { if (!IsValidEmailAddress(confirmID.value)) { return ErrMsg_ValidType; } else if (emailID.value != confirmID.value) { return ErrMsg_EmailVerify; } } } return ""; } function ValidateConfirmPassword() { var passwordID = document.getElementById("reg_user_Password"); confirmID = document.getElementById("reg_user_ConfirmPassword"); if (confirmID && passwordID) { if (passwordID.value !="" || confirmID.value != "") { if (passwordID.value != confirmID.value) { return ErrMsg_PasswordVerify; } } } return ""; } function ValidateBirthDate() { var mon = document.getElementById("reg_user_DOBMonth"); var day = document.getElementById("reg_user_DOBDay"); var year = document.getElementById("reg_user_DOBYear"); if (mon.value.length == 0 || day.value.length == 0 || year.value.length == 0) { return ErrMsg_Required; } if (mon.value.length>0 || day.value.length>0 || year.value.length>0) { var dt = mon.value + "/" + day.value + "/" + year.value; if (!isDate(dt)) return ErrMsg_ValidType; } return ""; }