

function validate() 
{
	
    var isError = false;
	var errStr = 'Could not proceed further, there is/are some error(s) in your form submission. Have a look on the error(s) below:\n\n';
	
	
	if (isError) {
		
		alert(errStr);
		return false;
		
	}

	else {
		
	   formSubmit();
		return false;
		
	}

}

function isValidEmail(email)
{
	return /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(email);
}
function isValidNum(phone)
{
	return /^\d*[0-9](|.\d*[0-9]|,\d*[0-9])?$/.test(phone);
}

function formSubmit()
{  
	
	var data = 'name=' + $("input[name=name]").val() + '&email=' + $("input[name=email]").val() + '&phone=' + $("input[name=phone]").val() + '&mobile=' + $("input[name=mobile]").val() + '&other=' + $("input[name=other]").val() + '&city=' + $("select[name=city]").val() + '&product=' + $("select[name=product]").val();
	
	$.ajax({
    type : "post",
    url : "action.php",
    data :data,
    success : function(msg){
	
		if(msg=="Mail successfully sent")
		
		 {
	     //$('#msg').show();
		 }
	
      }
  });
	
$("input[name=name]").val('');
$("input[name=phone]").val('');
$("input[name=email]").val('');
$("input[name=mobile]").val('');
$("select[name=product]").val('');
$("select[name=city]").val('');
$("input[name=other]").val('');
}


