If you read the "Work with Fields" tab in these plagiarized documents, I think you will find the answer.
For performance, you should probably keep a link to the form before binding ajaxForm.
$(document).ready(function() {
$foo = $('#foo');
$foo.ajaxForm({
error: function() {
alert($('#fieldId', $foo).fieldValue()[0]);
}
});
});