﻿// JavaScript Document
<!-- hide me

function validateAlumniReg(){
var testresults;
var strEmail = document.alumni_reg.txtEmail.value;
var strFirstName = document.alumni_reg.txtFname.value;
var strLastName = document.alumni_reg.txtLname.value;
var strNickname = document.alumni_reg.txtNickname.value;
var strUsername = document.alumni_reg.txtUsername.value;
var strPassword = document.alumni_reg.txtPassword.value;
var strsecuritycode = document.alumni_reg.securitycode.value;
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
//var dhfygiennum=/(^\d+$)|(^\d+\.\d+$)/;
var secnum=/[\d\D]+$/;
var telnum=/^[\d\s-\s+\(\)]+$/;
if(strEmail != "" && strFirstName != "" && strLastName != "" && strsecuritycode != "" && strNickname != "" && strUsername != "" && strUsername != "" )
{
	testresults=true;
	
	
	if (!secnum.test(strsecuritycode))
	{
		alert("Security Code does not match!");
		testresults=false;
	}
	if (!filter.test(strEmail))
	{
		alert("Invalid Email Address. Please try again!");
		testresults=false;
	}	
}
else
{
	var strAlert = "Please fill infomation in the blank fields";
	if(strFirstName == "")
	{
		strAlert = strAlert + " - First Name";
	}
	
	if(strLastName == "")
	{
		strAlert = strAlert + " - Last Name";
	}
	
	if(strNickname == "")
	{
		strAlert = strAlert + " - Nickname";
	}
	
	if(strEmail == "")
	{
		strAlert = strAlert + " - Email Address";
	}
	
	if(strUsername == "")
	{
		strAlert = strAlert + " - Username";
	}
	
	if(strPassword == "")
	{
		strAlert = strAlert + " - Password";
	}
	
	if(strsecuritycode == "")
	{
		strAlert = strAlert + " - Security Code";
	}
	alert(strAlert);
	testresults=false;
}
return (testresults);
}

// show me-->