// JavaScript Document
/* 	This is KForm Validator Config file.
	Set your code and variable inside the validate function and call the validate function on form submission.
*/

function KForm_Validate(f,e){

	//Attribute of form action
	KForm.url = f.action;
	
	/* 	Define your required fields start here */
	/* 	Use the id of the input field as member of KForm
		For example <input type="text" name="title" id="title" size="10" value="">
		Just write 
		KForm.title {
			"errmsg" : "Title is Required",
			"type" : "required"
		};
		It's case-sensitive!
	*/
	
	//STARTS HERE ===================================================================================
	
	//Name validation
	KForm.Name = {
		"errmsg" : "Your name is required", 
		"type" : "required" 
	};
	//Phone validation
	KForm.Phone = {
		"errmsg" : "Your phone number is required", 
		"type" : "required" 
	};
	
	//To add more field validation, copy the above code and replace KForm.Phone with the id of the input field. Enter your error message.
	
	//Email Validation
	KForm.Email = KForm.k_email;

	//ENDS HERE ============================================================================================
	
	//Below is the example for other validation
	
	//For Date format check
	//KForm.date = KForm.datecheck;
	/*
	//For time format check
	KForm.timeStart = Object.clone(KForm.timecheck); 
	KForm.timeStart.errmsg = "Start Time is required"; 
	KForm.timeStart.errmsg2 = "Start Time format is invalid";
	KForm.timeStart.timetype = "hh:mm:ss";
	
	KForm.timeEnd = Object.clone(KForm.timecheck); 
	KForm.timeEnd.errmsg = "End Time is required"; 
	KForm.timeEnd.errmsg2 = "End Time format is invalid";
	KForm.timeEnd.timetype = "hh:mm:ss";
	*/
	
	/* 	This validate special value */ 
	// 	For select/dropdown box 
	/* 	type = "valuecheck"
		checkvalue = is the value that tells KForm that user has not selected anything. 
		For example, a state dropdown box, the first index is "Select your state" and followed by QLD, NSW, NT, .....
		so assign whatever value in the option tag for "Select your state" to "checkvalue"
	*/
	//Example:	
	//KForm.telCode = {"errmsg" : "Area Code  is required", "type" : "valuecheck", "checkvalue" : "00" };
	
	
	//Do not modify this line unless you know what you are doing.
	KForm.eventclick = e;

	//Validate the form
	KForm.validate(f);

}