#  Dropdown not getting enabled

**URL:** <https://forum.wixstudio.com/t/dropdown-not-getting-enabled/20629>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [May 29, 2020, 1:24pm UTC](https://forum.wixstudio.com/t/dropdown-not-getting-enabled/20629 "2020-05-29T13:24:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tanveermustafa94](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/tanveermustafa94/32/19747_2.png) [@tanveermustafa94](https://forum.wixstudio.com/u/tanveermustafa94)\
**Post date:** [May 29, 2020, 1:24pm UTC](https://forum.wixstudio.com/t/dropdown-not-getting-enabled/20629/1 "2020-05-29T13:24:15Z")

</div>

Whenever I am doing conditional dropdown as explained by CodeQueen ,after the selection in the first dropdown the second dropdown is not getting enabled.

The sample code is below  
import wixData **from** ‘wix-data’ ;

$w.onReady( **function** () {

```
uniqueDropDown1(); 

```

});

**function** uniqueDropDown1 (){

```
wixData.query( "ifsc" ) 

    .limit( 1000 ) 

  .find() 

  .then(results => { 

```

**const** uniqueTitles = getUniqueTitles(results.items);

```
       $w( "#dropdownName1" ).options = buildOptions(uniqueTitles); 

  }); 

```

**function** getUniqueTitles(items) {

**const** titlesOnly = items.map(item =\> item.state);

**return** [… **new** Set(titlesOnly)];

```
} 

```

**function** buildOptions(uniqueList) {

**return** uniqueList.map(curr =\> {

**return** {label:curr, value:curr};

```
    }); 

} 

```

}

export function dropdownName2\_change(event) {  
//Add your code for this event here:

```
uniqueDropDown2(); 

$w( "#dropdownName" ).enable(); 

```

}

**function** uniqueDropDown2 (){

```
wixData.query( "ifsc" ) 

    .contains( "state" , $w( "#dropdownName1" ).value) 

    .limit( 1000 ) 

  .find() 

  .then(results => { 

```

**const** uniqueTitles = getUniqueTitles(results.items);

```
       $w( "#dropdownName" ).options = buildOptions(uniqueTitles); 

  }); 

```

**function** getUniqueTitles(items) {

**const** titlesOnly = items.map(item =\> item.city);

**return** [… **new** Set(titlesOnly)];

```
} 

```

**function** buildOptions(uniqueList) {

**return** uniqueList.map(curr =\> {

**return** {label:curr, value:curr};

```
    }); 

} 

```

}

Here dropdownName is not getting enabled.  
Thanks

---

<div class="post-metadata">

**Author:** ![givemeawhisky](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/givemeawhisky/32/5383_2.png) [@givemeawhisky](https://forum.wixstudio.com/u/givemeawhisky)\
**Post date:** [May 30, 2020, 1:05am UTC](https://forum.wixstudio.com/t/dropdown-not-getting-enabled/20629/2 "2020-05-30T01:05:19Z")

</div>

So you are using Nayeli (Code Queen) tutorial as shown here.  
[Conditional Filtering for Dropdowns on Wix | Corvid Tutorial](https://www.youtube.com/watch?v=EhXed0u6wh0)  
[https://codequeen.wixsite.com/dropdown](https://codequeen.wixsite.com/dropdown)  
[https://codequeen.wixsite.com/dropdown/code](https://codequeen.wixsite.com/dropdown/code)

The first question would be is your second dropdown called #dropdownName as you have the three of #dropdownName and #dropdownName1 and #dropdownName2 all used in your code when you are only using the two dropdown elements.

Especially where you have the onChange event on #dropdownName2 when I am pretty sure that it should be for the first dropdown used in this process.

Also, double check your code against hers on the tutorial and watch her YouTube video too, so that she can walk you through it all.

There is also this Wix Corvid example for dropdowns too.  
[https://www.wix.com/corvid/example/cascading-form](https://www.wix.com/corvid/example/cascading-form)
