$(document).ready(function() {
    
    $('#form1').clearForm();

   


    $('#form1').ajaxForm( {
        beforeSubmit: validate
    } );

    function validate(formData, jqForm, options) {
        // fieldValue is a Form Plugin method that can be invoked to find the
        // current value of a field
        //
        // To validate, we can capture the values of both the username and password
        // fields and return true only if both evaluate to true

        var nombreValue = $('input[@name=nombre]').fieldValue();
        var emailValue = $('input[@name=email]').fieldValue();
       
        var comentarioValue = $('textarea[@name=comentario]').fieldValue();



         


        // usernameValue and passwordValue are arrays but we can do simple
        // "not" tests to see if the arrays are empty
        if (!nombreValue[0]) {
            alert('Campo Nombre Vacio.');
            return false;
        }
        if (!emailValue[0]) {
            alert('Campo Email Vacio');
            return false;
        }
        if (!comentarioValue[0]) {
            

            alert('Campo Comentario Vacio');
            return false;
        }
     


        alert('Enviado');
        $('#form1').clearForm();

    }

});





