
/* CONTACT FORM VALIDATION */
$(document).ready(function() { 
    // validate signup form on keyup and submit 
    var validator = $("#contactForm").validate({
	focusInvalid : false,
        rules: { 
            name: "required",
			email: { 
                required: true, 
                email: true
            },
			captcha:{
				required:true,
				remote: "/captcha/captchaprocess.php"
			}
        }, 
        messages: { 
            name: "",
			email: "",
			captcha: ""
        }, 
        // the errorPlacement has to take the table layout into account 
        errorPlacement: function(error, element) { 
            if (element.is(":radio"))
                error.appendTo( element.parent().next().next() ); 
            else if ( element.is(":checkbox") ) 
                error.appendTo( element.parent().next() ); 
            else 
				if ( element.attr("name") == "passwords") 
					error.appendTo( element.next().next() );
				else					
				error.appendTo( element.next() ); 
        }
    }); 
 
});










