title: Returning form errors for AJAX request in Django
body: <p>I've been finding my way around Django and jQuery. I've built a basic form in Django. On clicking submit, I'm using jQuery to make an AJAX request to the sever to post my data. This bit seems to work fine and I've managed to save the data. Django returns a ValidationError when a form is invalid. Could anyone tell me how  to return this set of error messages as a response to my AJAX request so I can easily iterate through it using JS and do whatever?</p>
  
  <p>I found <a href="http://www.djangosnippets.org/snippets/992/" rel="noreferrer">this</a> snippet. Looking at the JS bit (processJson) you'll see that he seems to get the error messages by extracting them from the response HTML. It seems kinda kludgy to me. Is this the best way to go about it?</p>
  
  <p>My apologies for any vagueness.</p>
  
  <p>Thanks in advance.</p>