posabsolute/jQuery-Validation-Engine — Issue #242: [ajax form validation] uncaught exception when response is empty
Author: DanBadea
Created: 2012-01-10 15:49:33+00:00
State: open

Uncaught TypeError: Cannot read property 'length' of null

An exception is raised when a form is validated with ajax, if the response received from the server is empty. This exception should be caught, because it prevents the onAjaxFormComplete callback to be executed.

```javascript
success: function(json) {

if (json !== true) {

// getting to this case doesn't necessary means that the form is invalid
// the server may return green or closing prompt actions
// this flag helps figuring it out
var errorInForm=false;
for (var i = 0; i < json.length; i++) {
var value = json[i];
```