Questions tagged [slimselect]

Slim Select is a standalone, "advanced" dropdown to replace / improve the basic HTML select

About

Slim Select is an advanced select dropdown replacement.

  • No Dependencies
  • 20kb
  • Single or Multi Select
  • Callback Events

and other features

Methods

Use the API instead of DOM/jQuery select methods

Stack Overflow Starter

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/slim-select/1.27.0/slimselect.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/slim-select/1.27.0/slimselect.css"/>

<select id="single">
  <option value="value 1">Value 1</option>
  <option value="value 2">Value 2</option>
  <option value="value 3">Value 3</option>
</select>

JavaScript

new SlimSelect({
  select: '#single'
})
10 questions
2
votes
1 answer

Display the price of a coin after selecting its name in select

I use slim-select in which you can select the name of the coin, how to display its price after selecting the name (the price is in the database, i can find it by the name that is selected in the select)How can i do it(maybe i shoud use Ajax but…
2
votes
1 answer

Rails 7 JavaScript event listeners stop working after browser back?

I have rails 7 app where I'm trying to build a search bar using either tom-select or slim-select. My issue reproduces no matter which library I'm using therefore it must be the issue on my rails side. app/views/cities/index.html.erb <%= form_for…
2
votes
0 answers

How can I create variables recursively in a loop?

I am using a plugin called Slim Select SlimSelect. At the moment I am creating N° select with a foreach loop, and I need to set previous saved options within each select. The problem is, I cannot create variables recursively (or at least I don't…
d0t_m
  • 87
  • 7
1
vote
1 answer

building multiple SlimSelect objects in a loop - only last object works

I am trying to build a html list with each item in the list having a SlimSelect object with a multiple select dropdown. However, when i run the code below, only the last item is active... the other items do not work. I am not sure why this is…
0
votes
1 answer

Slim select doesn't work when embedded in a modal

When I use a slim select in bootstrap modal, I can't type anything into it. Outside the modal slim select works fine. Here is my code:
0
votes
1 answer

laravel livewire breaks styling (@push script)

I applied livewire on top of an already made laravel project. It's simply applying wire:model to select like below. and using the wire…
hyukkyulee
  • 1,024
  • 1
  • 12
  • 17
0
votes
1 answer

2 fields SlimSelect - Single and Multi - with results from Json

I am using Slimselect to create my dropdowns, and I have two related fields, it is: Single Select : "Aréa de atuação principal *" and Multi Select : "Outras áreas de atuação" I am trying to hide one option from the second select (Outras áreas de…
Sophie
  • 410
  • 3
  • 10
0
votes
1 answer

How to load an initial value (and select it) in an Ajax controlled slim-select?

I'm migrating my rails app from select2 to slim-select. I have a select menu where a user selects their location for the day, and that menu loads pre-selected to the location the user saved yesterday. If their location changed, they can use the…
hellion
  • 4,602
  • 6
  • 38
  • 77
0
votes
3 answers

How can I prevent duplicate and blank entries in a slimselectjs multiselect?

I am using a slimselectjs multiselect plugin and have an HTML form which submits to it in order to add selected option values. However, when adding selected option values via the form, duplicates can be created if I enter the same text and label.…
aa155
  • 5
  • 2
-1
votes
2 answers

How to select an option of a slim select with jquery

I have some concatenated selects that work fine. By the way, I would like to convert those selects into slim selects but I found some difficulties in doing that. For example, I have a select with ID level_incarico. When I select an option of…
Michele Della Mea
  • 966
  • 2
  • 16
  • 35