# Autoselect Inputs Cannot be more than one in a modul

**URL:** <https://talk.observablehq.com/t/autoselect-inputs-cannot-be-more-than-one-in-a-modul/3796>\
**Category:** Help\
**Created:** [August 28, 2020, 6:54am UTC](https://talk.observablehq.com/t/autoselect-inputs-cannot-be-more-than-one-in-a-modul/3796 "2020-08-28T06:54:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Srabutdotcom](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/srabutdotcom/32/3182_2.png) [@Srabutdotcom](https://talk.observablehq.com/u/Srabutdotcom)\
**Post date:** [August 28, 2020, 6:54am UTC](https://talk.observablehq.com/t/autoselect-inputs-cannot-be-more-than-one-in-a-modul/3796/1 "2020-08-28T06:54:04Z")

</div>

I tried to use more than one of autoselect from @jashkenas/inputs but the second autoselect input option data always refering to the first autoselect.

```
viewof p = autoSelect({  
             value:"",
             title:"first",
             options: firstopt,     
}) 

```

The second are:

```
 viewof p = autoSelect({  
             value:"",
             title:"second",
             options: secondopt,     
}) 

```

The first autoselect works perfectly and the second also but with the same option with first autoselect.,

Please help

---

<div class="post-metadata">

**Author:** ![aaronkyle](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/aaronkyle/32/8106_2.png) [@aaronkyle](https://talk.observablehq.com/u/aaronkyle)\
**Post date:** [August 28, 2020, 8:36am UTC](https://talk.observablehq.com/t/autoselect-inputs-cannot-be-more-than-one-in-a-modul/3796/2 "2020-08-28T08:36:35Z")

</div>

Is the problem you’re experiencing is because you’ve used ‘p’ twice as a name?

Maybe try:

```auto
viewof p = autoSelect({  
             value:"",
             title:"first",
             options: firstopt,     
}) 

 viewof q = autoSelect({  
             value:"",
             title:"second",
             options: secondopt,     
}) 

```

**EDIT** Sorry, I see now the behavior you’re reporting. Is it a somehow a bug of the platform or of JS in general, or maybe a browser memory thing?

Here’s a demo that reproduces your behavior:

> **[Multiple Selections](https://observablehq.com/d/1cb21ee9836e9874)**
>
> An Observable notebook by Aaron Kyle Dennis.

---

<div class="post-metadata">

**Author:** ![Srabutdotcom](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/srabutdotcom/32/3182_2.png) [@Srabutdotcom](https://talk.observablehq.com/u/Srabutdotcom)\
**Post date:** [August 28, 2020, 10:53am UTC](https://talk.observablehq.com/t/autoselect-inputs-cannot-be-more-than-one-in-a-modul/3796/3 "2020-08-28T10:53:56Z")

</div>

Thanks for your feedback,.

Actually i have made both with different name of viewof.,  
And the problem have been resloved by adding list name into config to differetiate both object.

Thanks

---

<div class="post-metadata">

**Author:** ![aaronkyle](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/aaronkyle/32/8106_2.png) [@aaronkyle](https://talk.observablehq.com/u/aaronkyle)\
**Post date:** [August 28, 2020, 2:41pm UTC](https://talk.observablehq.com/t/autoselect-inputs-cannot-be-more-than-one-in-a-modul/3796/4 "2020-08-28T14:41:16Z")

</div>

Cool. It’s weird, when I first responded to you, I swear was seeing different inputs. Now there’s nothing I can do to get around the behavior you describe.

Would you be willing to share your fix?

---

<div class="post-metadata">

**Author:** ![Srabutdotcom](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/srabutdotcom/32/3182_2.png) [@Srabutdotcom](https://talk.observablehq.com/u/Srabutdotcom)\
**Post date:** [August 28, 2020, 3:56pm UTC](https://talk.observablehq.com/t/autoselect-inputs-cannot-be-more-than-one-in-a-modul/3796/5 "2020-08-28T15:56:28Z")

</div>

I think there is not error or bug in Autoselect but we don’t know or not enough guide to do it correctly.  
Here is my solution that already prepared in autoselect config.

```
  viewof a = autoSelect({
  list:"a", options: opta)}

```

And the other AutoSelect are like this

```
  viewof b = autoSelect({
  list:"b", options: optb)}

```

But what i don’t like with this input are, that if we want to change the value the list of option are not showing except we should delete the value first.

---

<div class="post-metadata">

**Author:** ![aaronkyle](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/aaronkyle/32/8106_2.png) [@aaronkyle](https://talk.observablehq.com/u/aaronkyle)\
**Post date:** [August 29, 2020, 6:50pm UTC](https://talk.observablehq.com/t/autoselect-inputs-cannot-be-more-than-one-in-a-modul/3796/6 "2020-08-29T18:50:10Z")

</div>

Hi again.

Good call on the list! And yes - I see what you mean about having to clear all the text before you get the list of values back. Not ideal.

Here’s one that might work better for you:

> **[Multi Auto Select](https://observablehq.com/@john-guerra/multi-auto-select)**
>
> An Observable notebook by John Alexis Guerra Gómez.

---

<div class="post-metadata">

**Author:** ![mootari](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mootari/32/581_2.png) [@mootari](https://talk.observablehq.com/u/mootari)\
**Post date:** [August 30, 2020, 9:08am UTC](https://talk.observablehq.com/t/autoselect-inputs-cannot-be-more-than-one-in-a-modul/3796/7 "2020-08-30T09:08:05Z")

</div>

You might also be interested in [Choices](https://joshuajohnson.co.uk/Choices/), an alternative to [Select2](https://select2.org/) and [Chosen](https://harvesthq.github.io/chosen/) that doesn’t require jQuery. I found an example implementation here:

> **[Hello, Choices!](https://observablehq.com/@bayre/hello-choices)**
>
> An Observable notebook by Ben Ayre.
