# Validating Values

The Kendo UI for Angular Barcode package provides the [`createBarcodeValidator`](https://www.telerik.com/kendo-angular-ui-develop/components/barcodes/api/createbarcodevalidator) function for Angular Reactive Forms. The validator checks whether a value is valid for the selected Barcode type.

Pass a [`BarcodeType`](https://www.telerik.com/kendo-angular-ui-develop/components/barcodes/api/barcodetype) to validate the value. You can also pass the optional barcode size when the selected type requires it. The validator accepts string and numeric values, returns `null` for empty values, and returns a `barcode` error with the validation message, value, and type when validation fails.

The following example demonstrates the Barcode validator in action.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/barcodes/barcode/validator/source.txt)

## Suggested Links

* [`createBarcodeValidator` API Reference](https://www.telerik.com/kendo-angular-ui-develop/components/barcodes/api/createbarcodevalidator)
* [BarcodeComponent API Reference](https://www.telerik.com/kendo-angular-ui-develop/components/barcodes/api/barcodecomponent)
* [`BarcodeType` API Reference](https://www.telerik.com/kendo-angular-ui-develop/components/barcodes/api/barcodetype)
