> For the complete documentation index, see [llms.txt](https://docs.wirebootstrap.com/wirebootstrap/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wirebootstrap.com/wirebootstrap/utilities/validation.md).

# Validation

Validate multiple HTML elements on a page using the [wire.ui.validate](https://docs.wirebootstrap.com/wirebootstrap/reference/wire.ui/wire.ui.validate) method.  This method will apply the validation configuration UI changes to the elements that fail validation.  It will return `true` if all the elements pass validation and `false` if at least one does not.

This method uses the [wire.validate](https://docs.wirebootstrap.com/wirebootstrap/reference/wire/wire.ui.validate) method for each element's validation.

## Example

The following example validates three HTML elements.  All three are required.  `user-phone` needs to be a valid phone number and `user-email` needs to be a valid email address.  If any of these conditions fail, the `validate` method will return `false`.  The CSS class `invalid` will be added to any elements that fail validation.

```javascript
const valid = wire.ui.validate(document, {
    css: "invalid",
    elements: {
        'user-name': { required: true },
        'user-phone': { required: true, type: "phone" },
        'user-email': { required: true, type: "email" }
    }
});
```

For more on this method, visible [wire.ui.validate](https://docs.wirebootstrap.com/wirebootstrap/reference/wire.ui/wire.ui.validate).
