rickharrison/validate.js — pull request #58 by deefour (2013-03-08 15:40:58+00:00)
Title: Only validate fields that actually exist

Currently with a validator like

```javascript
{
name: 'user[first_name]',
rules: 'required|max_length[30]'
}
```

the validator will run against this object even if the `user[first_name]` field doesn't actually exist in the form at the time of the validation.

Perhaps there is well thought reasoning for this, but I thought I'd propose a different behavior, to **ignore validations against non-existing form fields**.

------------------

I work in applications that contain users with varying permissions. A user account form for an admin will have many more fields present than that same form for a less privileged user. It's cumbersome to wrap validation for such conditionally rendered fields in conditionals to test for each field's presence.