# I want to give validation on extension field which is created from custom component

**URL:** <https://forum.shopware.com/t/i-want-to-give-validation-on-extension-field-which-is-created-from-custom-component/103037>\
**Category:** Shopware 6 (English)\
**Tags:** administration\
**Created:** [20. Februar 2024 um 06:39 UTC](https://forum.shopware.com/t/i-want-to-give-validation-on-extension-field-which-is-created-from-custom-component/103037 "2024-02-20T06:39:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![conversios](https://avatars.discourse-cdn.com/v4/letter/c/977dab/32.png) [@conversios](https://forum.shopware.com/u/conversios)\
**Post date:** [20. Februar 2024 um 06:39 UTC](https://forum.shopware.com/t/i-want-to-give-validation-on-extension-field-which-is-created-from-custom-component/103037/1 "2024-02-20T06:39:33Z")

</div>

I want to give validation on extension field which is created from custom component.Here I am attaching screen short of it.

 ![Screenshot from 2024-02-20 12-06-22](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/3X/e/b/eb7f4ada8e179ce759af2da1243487932799cb66.png)

So please share me link how can I do it? If I can do it directly from javascript like below

> configString=document.getElementById(„Conv1ServersideTagging.config.containerConfig“).value;  
> regionId=document.getElementsByClassName(„sw-single-select\_\_selection-text“)[1].innerText;
> 
> ```
> if(regionId=="")
> {
> alert("Please select value in Region");
> this.isLoading = false;
> if(document.querySelector('[name="Conv1ServersideTagging.config.region"]').classList.contains('error'))
> document.querySelector('[name="Conv1ServersideTagging.config.region"]').classList.remove('error');
> else
> document.querySelector('[name="Conv1ServersideTagging.config.region"]').classList.add('error');
> return false;
> }
> if(configString=="")
> {
> alert("Please enter value in Google Tag Manager (Server) Container Config");
> this.isLoading = false;
> if(document.querySelector('[name="Conv1ServersideTagging.config.containerConfig"]').classList.contains('error'))
> document.querySelector('[name="Conv1ServersideTagging.config.containerConfig"]').classList.remove('error');
> else
> document.querySelector('[name="Conv1ServersideTagging.config.containerConfig"]').classList.add('error');
> return false;
> }
> 
> ```

Is it accept by showare team or not?
