
function ValidateSubmitTicket() 
{

if (document.ticket.ticketsubject.value == ""){
alert("You must enter a ticket subject");
return false;
}

if (document.ticket.project.value == "" || document.ticket.project.value == "Select One"  ){
alert("You must select a project");
return false;
}

if (document.ticket.type.value == "" || document.ticket.type.value == "Select One"){
alert("You must select a type");
return false;
}

if (document.ticket.priority.value == "" || document.ticket.priority.value == "Select One" ){
alert("You must select a priority");
return false;
}

if (document.ticket.comments.value == ""){
alert("You must enter ticket issue details");
return false;
}

maxlength=1000;
if(document.ticket.comments.value.length>=maxlength) {
	alert('Your issue must be 1000 characters or less');
	return false;
}

}

<!-- Change Password



function ValidateChangePassword ( )
{
	
//Check Password
var alphaExp3 = /^[0-9a-zA-Z]+$/;
	if(document.changepassword.password.value.match(alphaExp3)){
		
	}else{
alert("You must enter a valid existing password");
return false;
}

var uInput = document.changepassword.password.value;
var min= '4';
var max= '20';
	if(uInput.length >= min && uInput.length <= max){
	}else{
		alert("Password1 must be between " +min+ " and " +max+ " characters");
		return false;
	}
	
	
	
//Check Password1
var alphaExp3 = /^[0-9a-zA-Z]+$/;
	if(document.changepassword.password1.value.match(alphaExp3)){
		
	}else{
alert("You must enter a valid new password");
return false;
}

var uInput = document.changepassword.password1.value;
var min= '4';
var max= '20';
	if(uInput.length >= min && uInput.length <= max){
	}else{
		alert("Password1 must be between " +min+ " and " +max+ " characters");
		return false;
	}



//Check Password2
var alphaExp4 = /^[0-9a-zA-Z]+$/;
	if(document.changepassword.password2.value.match(alphaExp4)){
		
	}else{
alert("You must enter a valid new password");
return false;
}

var uInput = document.changepassword.password2.value;
var min= '4';
var max= '20';
	if(uInput.length >= min && uInput.length <= max){
	}else{
		alert("Password2 must be between " +min+ " and " +max+ " characters");
		return false;
	}



 var e1 = document.changepassword.password1.value
  var e2 = document.changepassword.password2.value
  if (!(e1==e2) )
  {
    alert ("Passwords entered do not match. Please re-enter.")
	return false;
  }

	
}




//Validate Update Details

function ValidateUpdateDetails ( )
{

//Check First Name
var alphaExp = /^[0-9a-zA-Z\s\/-]+$/;
	if(document.update.firstname.value.match(alphaExp)){
		
	}else{
alert("You must enter a valid first name");
return false;
}


//Check Last Name
var alphaExp = /^[0-9a-zA-Z\s\/-]+$/;
	if(document.update.lastname.value.match(alphaExp)){
		
	}else{
alert("You must enter a valid last name");
return false;
}


//Check email
var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
if(document.update.email.value.match(emailExp)){				
}else{
alert("You must enter a valid email address");
return false;
}


}




//Validate Admin Options

function ValidateAdminOptions ( )
{

//Check email
var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
if(document.adminoptions.adminemail.value.match(emailExp)){				
}else{
alert("You must enter a valid email address");
return false;
}

//Check Days
var alphaExp4 = /^[0-9]+$/;
	if(document.adminoptions.displayclosed.value.match(alphaExp4)){
		
	}else{
alert("Number of days must be numeric");
return false;
}

//Check Days
var alphaExp4 = /^[0-9]+$/;
	if(document.adminoptions.weeklyemaillimit.value.match(alphaExp4)){
		
	}else{
alert("Weekly email limit must be numeric");
return false;
}


}




//Validate Ticket Update

function ValidateTicketResponse ( )
{
	
//Check Days
var alphaExp4 = /^[0-9.]+$/;
	if(document.response.esteffort.value.match(alphaExp4)){
		
	}else{
alert("Estimated effort must be numeric");
return false;
}


//Check Days
var alphaExp4 = /^[0-9.]+$/;
	if(document.response.acteffort.value.match(alphaExp4)){
		
	}else{
alert("Actual effort must be numeric");
return false;
}



}





function ValidateResponse() 
{

/*if (document.response.comments.value == ""){
alert("You must enter response details");
return false;
}*/

maxlength=1000;
if(document.response.comments.value.length>=maxlength) {
	alert('Your issue must be 1000 characters or less');
	return false;
}

alert('Response Added Sucessfully');

}
















//Validate Add user

function ValidateAddUsers ( )
{

//Check First Name
var alphaExp = /^[0-9a-zA-Z\s\/-]+$/;
	if(document.ticket.firstname.value.match(alphaExp)){
		
	}else{
alert("You must enter a valid first name");
return false;
}


//Check Last Name
var alphaExp = /^[0-9a-zA-Z\s\/-]+$/;
	if(document.ticket.lastname.value.match(alphaExp)){
		
	}else{
alert("You must enter a valid last name");
return false;
}


//Check email
var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
if(document.ticket.email.value.match(emailExp)){				
}else{
alert("You must enter a valid email address");
return false;
}

//Check Username
var alphaExp2 = /^[0-9a-zA-Z]+$/;
	if(document.ticket.username.value.match(alphaExp2)){
		
	}else{
alert("You must enter a valid username");
return false;
}

	
var uInput = document.ticket.username.value;
var min= '4';
var max= '20';
	if(uInput.length >= min && uInput.length <= max){
	}else{
		alert("Username must be between " +min+ " and " +max+ " characters");
		return false;
	}

//Check Role
if (document.ticket.role.value == ""){
alert("You must enter a valid role");
return false;
}
	
//Check Password1
var alphaExp3 = /^[0-9a-zA-Z]+$/;
	if(document.ticket.password1.value.match(alphaExp3)){
		
	}else{
alert("You must enter a valid new password");
return false;
}

var uInput = document.ticket.password1.value;
var min= '4';
var max= '20';
	if(uInput.length >= min && uInput.length <= max){
	}else{
		alert("Password1 must be between " +min+ " and " +max+ " characters");
		return false;
	}



//Check Password2
var alphaExp4 = /^[0-9a-zA-Z]+$/;
	if(document.ticket.password2.value.match(alphaExp4)){
		
	}else{
alert("You must enter a valid new password");
return false;
}

var uInput = document.ticket.password2.value;
var min= '4';
var max= '20';
	if(uInput.length >= min && uInput.length <= max){
	}else{
		alert("Password2 must be between " +min+ " and " +max+ " characters");
		return false;
	}



 var e1 = document.ticket.password1.value
  var e2 = document.ticket.password2.value
  if (!(e1==e2) )
  {
    alert ("Passwords entered do not match. Please re-enter.")
	return false;
  }


}





//Validate Update Details

function ValidateUpdateDetails ( )
{

//Check First Name
var alphaExp = /^[0-9a-zA-Z\s\/-]+$/;
	if(document.user.firstname.value.match(alphaExp)){
		
	}else{
alert("You must enter a valid first name");
return false;
}


//Check Last Name
var alphaExp = /^[0-9a-zA-Z\s\/-]+$/;
	if(document.user.lastname.value.match(alphaExp)){
		
	}else{
alert("You must enter a valid last name");
return false;
}


//Check email
var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
if(document.user.email.value.match(emailExp)){				
}else{
alert("You must enter a valid email address");
return false;
}


}





//Validate Add Project

function ValidateAddProject ( )
{

//Check First Name
var alphaExp = /^[0-9a-zA-Z\s\/-]+$/;
	if(document.project.projectname.value.match(alphaExp)){
		
	}else{
alert("You must enter a valid project name");
return false;
}


//Check Last Name
var alphaExp = /^[0-9a-zA-Z\s\/-]+$/;
	if(document.project.projectdesc.value.match(alphaExp)){
		
	}else{
alert("You must enter a valid project description");
return false;
}


//Check Dev
if (document.project.primarydev.value == ""){
alert("You must enter a valid developer");
return false;
}


}

//Validate Search
function ValidateSearch ()
{
	//Check Dev
if (document.search1.searchcriteria.value == ""){
alert("You must enter valid search criteria");
return false;
}


}



//Validate Create Test Spec
function ValidateTestSpec ()
{
	//Check sectiontitle
if (document.testspec.sectiontitle.value == ""){
alert("You must enter valid name for the Test Specification");
return false;
}

}

//Validate Create Module
function ValidateModule ()
{
	//Check moduletitle
if (document.testspec.moduletitle.value == ""){
alert("You must enter valid name for the Module");
return false;
}

}

//Validate Create Test
function ValidateTest ()
{
	//Check moduletitle
if (document.testspec.testaction.value == ""){
alert("You must enter valid Action");
return false;
}

	//Check moduletitle
if (document.testspec.testresult.value == ""){
alert("Please enter a valid Expected Result");
return false;
}


}

//Validate Create Iteration
function ValidateIteration ()
{
	//Check moduletitle
if (document.testspec.iterationtitle.value == ""){
alert("You must enter valid name for the Iteration");
return false;
}

}




