
$(document).ready(function() {

	$("#freeform").ajaxForm({  
		target:"#hiddenDIV",         
	  	beforeSubmit:function(e){
	  	
	  	var sendFrm = true;
	  		$(".required").each(function(){
	  			if($(this).val()==""){
	  				$(this).css("border","1px solid red");
	  				
	  			var cb = $(this).closest('td').prev('td').css('cssText',"color:red !important"); // input within TD
					
					sendFrm = false;
	  			}
	  		});
	  		if(!sendFrm){
	  			$("#hiddenDiv").html("<span class='error'>We hebben deze gegevens echt nodig.  <br />Vult u die alstublieft in.</span>");
	  			return false;
	  		}	
	    },
	  	complete:function(rtn){
			$(".inputText").each(function(){
				$(this).val("");
				$(this).css("border","1px solid #766A62");
			});
				$("#hiddenDiv").text("Bedankt voor uw reactie! Wij nemen zo spoedig mogelijk contact met u op!");
					  			
	  	},
	   	success:function(rtn){}}
	   	);
});





