caolan/forms — pull request #117 by nicksellen (2014-04-29 16:21:20+00:00)
Title: continue to validate fields after first error

I found only the first validation error was being reported when multiple fields were in error.

This was my scenario:

a form with three required fields (title, description, date):

```js
var form = forms.create({
title: fields.string({required: true}),
description: fields.string({ required: true }),
date: fields.date({ required: true })
});
```
submitting a form with empty values for each:

```js
{ title: '', description: '', date: '' }
```

only getting back errors for the first field (title):

```js
form.handle(req, {
error: function(form){
var errors = Object.keys(form.fields).map(function(f){
return form.fields[f].error;
});
console.log('errors', errors);
}
})
```

prints out:

```
errors [ 'title is required.', undefined, undefined ]
```

It seems more sensible to me to validate all fields in one go, to allow the user to correct everything; currently they would probably assume the fields without errors are valid, and only find out after correcting the first error.

I added one test, and it passes all the existing ones.

Thanks for the library too!