0

Select option multiple tags work well in tablet , I can choose values save etc but in laptop chrome its looks like ul li and cant see checks , click etc <select name="" multiple> <option> </option> 5 times </select> actually I wanna create like that something I think it can solve this problem but without search section

enter image description here

its work so well in android you can see but in Windows its not like that.. I cant use multiple select options

enter image description here

General Grievance
  • 4,555
  • 31
  • 31
  • 45
  • Please give screenshots of what output you expect and what it currently is. Also, show some code. We can't help you without knowing the problem. – Akash Jun 11 '21 at 15:07
  • The Windows UI for selecting multiple options is to hold down control as you pick them. It doesn't render them as checkboxes. – Quentin Jun 11 '21 at 15:12
  • ` – zer00ne Jun 11 '21 at 15:15
  • So use them. Just use the UI the standard Windows way instead of expecting it to look like Android. – Quentin Jun 11 '21 at 15:18

1 Answers1

1

What you want to do is already answered in this link. For your convenience, I have provided the jsfiddle.

var expanded = false;

function showCheckboxes() {
  var checkboxes = document.getElementById("checkboxes");
  if (!expanded) {
    checkboxes.style.display = "block";
    expanded = true;
  } else {
    checkboxes.style.display = "none";
    expanded = false;
  }
}
.multiselect {
  width: 200px;
}

.selectBox {
  position: relative;
}

.selectBox select {
  width: 100%;
  font-weight: bold;
}

.overSelect {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
}

#checkboxes {
  display: none;
  border: 1px #dadada solid;
}

#checkboxes label {
  display: block;
}

#checkboxes label:hover {
  background-color: #1e90ff;
}
<form>
  <div class="multiselect">
    <div class="selectBox" onclick="showCheckboxes()">
      <select>
        <option>Select an option</option>
      </select>
      <div class="overSelect"></div>
    </div>
    <div id="checkboxes">
      <label for="one">
        <input type="checkbox" id="one" />First checkbox</label>
      <label for="two">
        <input type="checkbox" id="two" />Second checkbox</label>
      <label for="three">
        <input type="checkbox" id="three" />Third checkbox</label>
    </div>
  </div>
</form>
Raky
  • 625
  • 5
  • 19
  • In this code example, I have tried to resolve your query regarding `multiple` `select` using `checkbox`. Now what you are asking is a next step. Please do little research for the next step of storing the selected options in `value[]`. `stackoverflow.com` is fantastic. you will get your answer. I ain't telling you because then you will not learn. – Raky Jun 11 '21 at 15:24