    // prepare the form when the DOM is ready 
    $(document).ready(function() { 
        var options = { 
            target:        '#frmInfo',   // target element(s) to be updated with server response 
            beforeSubmit:  validate,  // pre-submit callback 
            success: clearFields
        }; 
 
        $('#commentsFrm').submit(function() { 
            $(this).ajaxSubmit(options); 
            return false; 
        }); 

        var options2 = { 
            target:        '#frmInfo2',   // target element(s) to be updated with server response 
            beforeSubmit:  validate,  // pre-submit callback 
            success: clearFields2
        }; 
 
        $('#mailingFrm').submit(function() { 
            $(this).ajaxSubmit(options2); 
            return false; 
        }); 
    });
    
    function clearFields() {
      $('#name').val("");
      $('#email').val("");
      $('#comments').val("");
      return true;
    }
    
    function clearFields2() {
      document.mailingFrm.name.value = '';
      document.mailingFrm.email.value = '';
      return true;
    }
    
    function validate(formData, jqForm, options) { 
        var form = jqForm[0]; 
        if (!form.name.value || !form.email.value) { 
            alert('Please enter a value for both Name and Email'); 
            return false; 
        } 
        //alert('Both fields contain values.'); 
      }