var validations = new Array(); validations[0] = new Validation("reg_user_FirstName", "", "Alpha", "Y", 50, "", "", "Please enter your first name.", "") validations[1] = new Validation("reg_user_LastName", "", "Alpha", "Y", 25, "", "", "Please enter your last name.", "") validations[2] = new Validation("reg_user_Address1", "", "", "Y", 40, "", "", "Please enter a street address.", "") validations[3] = new Validation("reg_user_Address2", "", "", "", 40, "", "", "", "") validations[4] = new Validation("reg_user_EmailAddress", "", "Email", "Y", 70, "", "", "Please enter a valid e-mail address.", "") validations[5] = new Validation("reg_user_ConfirmEmail", "", "", "Y", "", "", "", "Please make sure the e-mail address matches the first one you entered.", "ValidateConfirmEmail") validations[6] = new Validation("reg_user_City", "", "Alpha", "Y", 40, "", "", "Please enter a city.", "") validations[7] = new Validation("reg_user_State", "", "MultiSelect", "Y", "", "", "", "Please select a state.", "") validations[8] = new Validation("reg_user_Zip", "", "Numeric", "Y", 5, 5, "", "Please enter a zip code.", "") validations[9] = new Validation("reg_user_Specialty", "", "MultiSelect", "", "", 1, "", "Please enter medical specialty.", "") 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; } } } if (confirmID.value == ""){ return "Please make sure the e-mail address matches the first one you entered."; } 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 ""; }