// JavaScript Document
$(document).ready(function() {
 var options = { 
  beforeSubmit: validate,
  //success: showResponse,
  clearForm: true
 };
 
     $('#contactForm').ajaxForm(options); 

   });


function validate(formData, jqForm, options) { 
    // jqForm is a jQuery object which wraps the form DOM element 
    // 
    // To validate, we can access the DOM elements directly and return true 
    // only if the values of both the username and password fields evaluate 
    // to true 
 
    var form = jqForm[0]; 
    if (!form.name.value || !form.email.value || !form.enq.value) { 
    $('#response').html("<h3>Oops!</h3><p>Please make sure all fields marked with a * are complete.</p>");
        return false; 
    } 
    $('#response').html("<h3>Thanks!</h3><p>We will be in touch soon.</p>");
}
