# Validation inside slots

**URL:** <https://discourse.aurelia.io/t/validation-inside-slots/3877>\
**Category:** Help Requests\
**Created:** [November 6, 2020, 7:31pm UTC](https://discourse.aurelia.io/t/validation-inside-slots/3877 "2020-11-06T19:31:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sousekd](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/sousekd/32/1705_2.png) [@sousekd](https://discourse.aurelia.io/u/sousekd)\
**Post date:** [November 6, 2020, 7:31pm UTC](https://discourse.aurelia.io/t/validation-inside-slots/3877/1 "2020-11-06T19:31:59Z")

</div>

Hi, are there any specialties I should know about when using Aurelia Validation with content projection using **slots**?

I have a custom control with two-way bindable property called **value**. Inside the custom control there is `<input type="text" value.bind="value" blur.trigger="blur()">`. I bind a value to this custom control from outside using `<custom-control value.bind="something & validate"></custom-control>`. The validation works well.

But when I move the `<input>` element from the custom control one-level deeper, having `<something-with-default-slot><input type="text" value.bind="value" blur.trigger="blur()"></something-with-default-slot>` in the original custom control instead, the value doesn’t get validated, even if manually asked for.

Thanks!

---

<div class="post-metadata">

**Author:** ![sousekd](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/sousekd/32/1705_2.png) [@sousekd](https://discourse.aurelia.io/u/sousekd)\
**Post date:** [November 6, 2020, 9:44pm UTC](https://discourse.aurelia.io/t/validation-inside-slots/3877/2 "2020-11-06T21:44:57Z")

</div>

Ignore me :-). Just realized it is likely caused by the ValidationRenderer which expects the DOM to look a bit differently. The usage of the extra template with slots sent my HTML control to a different place…

I am new to Aurelia Validation and would use some tips on how to structure it: I have several forms with validation, which are composed of quite complex structure of custom elements with the real HTML controls somewhere deeper in the hierarchy. Is it a common pattern to instantiate/add ValidationRenderers into the injected ValidationController in the custom controls deeper in the hierarchy themselves? For now I use just one ValidationRenderer for my HTML controls wrapper, and I add it to a controller at the root form component, but I have a feeling I may need more, for lists etc…
