How do you correctly handle errors using PT Contact Form when submitting via AJAX?
If you want the error messages to be displayed identical to P&amp;T's template/macro default, this should do the trick:

$(function(){
    $('#ajax-form').submit( function(ev) {

        // Prevent the form from actually submitting
        ev.preventDefault();

        // Remove any existing error messages from previous attempts
        $(this).find( '.errors' ).remove();

        // Get the post data
        var data = $(this).serialize();

        // Send it to the server
        $.post('/', data, function(response) {

            if (response.success) {

                // All good!
                $('#thanks').fadeIn();

            } else {

                // Loop through the errors and append to relevant fields
                for ( var fieldId in response.error ) {

                    // Create the &lt;ul&gt;
                    var $errors = $( '&lt;ul class="errors" /&gt;' );

                    // Wrap the error messages in &lt;li&gt; tags
                    var messages = $.map(response.error[fieldId], function(message){
                        return '&lt;li&gt;' + message + '&lt;/li&gt;';
                    });

                    // Append the error messages to the ul
                    $errors.append( messages.join( '' ) );

                    // Select the input element and append the .errors &lt;ul&gt; after it.
                    $('#'+fieldId).after($errors);

                }

            }
        });
    });
});


Just to be clear though, the PT Contact Form template doesn't force you to display your error messages in any given way; both the contact form template as a whole, and specifically how error messages are displayed (both the template macro for non-Ajax requests and the stuff in the response.error object) is obviously totally up to you.