function validateFields(){

var arrError = [];

var strName = document.getElementById("name").value;
var strHomeTelNo = document.getElementById("home_tel_no").value;
var strBestContactNo = document.getElementById("best_contact_no").value;

if(strName == ""){
 arrError.push("Please enter your name"); 
}
if(strHomeTelNo == ""){
 arrError.push("Please enter your home telephone number"); 
}else if(isNaN(strHomeTelNo)){
 arrError.push("Please enter valid home telephone number"); 
}
if(strBestContactNo == ""){
 arrError.push("Please enter your best contact number"); 
}else if(isNaN(strBestContactNo)){
 arrError.push("Please enter valid best contact number"); 
}

var intLen = arrError.length;

if(intLen == 0){
	return true;
}else{
    var strErrorMsg = "Please corret the following";
	strErrorMsg += "\n---------------------------------------------------------\n---------------------------------------------------------\n";
	for(var i=0;i<intLen;i++){
	 strErrorMsg += (i+1)+". "+arrError[i]+"\n";
	}
	alert(strErrorMsg);
	return false;
}

}