Error Selectors

The errors.first and errors.has methods don't only provide you with a way to fetch the first input for a specific field, they also allow you to filter it down further to a specific rule, using the following syntax 'field:rule'. Even more, they allow you to filter it down to a specific scope using 'scope.field', so if you want to display the first error for the email field in the newsletter form but only if the rule is email.

errors.first('newsletter.email:email');

In the example below, you have a collection of errors and you may use the input to filter down the errors. Note that it is by default the error bag will not have multiple errors of the same input since the validator bails upon first rule that fails.

Edit VeeValidate Examples