garygreen / dominar

Lightweight bootstrap validator inspired by Laravel
http://garygreen.github.io/dominar/
22 stars 4 forks source link

'first' can't be used as a name attribute #15

Closed stocksp closed 8 years ago

stocksp commented 9 years ago

If 'first' is used as the name attribute like: <input name="first" type="text" class="form-control"/> Dominar gets confused and we crash in line 815

validate.reject(this.validator.errors.first(name));

with 'first' as the name, errors becomes an array which doesn't have a first method.

Very easy to see in your demo.. Just change 'userName' to 'first' and you get the error.

garygreen commented 9 years ago

Yeah, this is an issue with validatorjs as in https://github.com/skaterdav85/validatorjs/issues/56

Will be fixed when I release validator js 2.0