delete this question delete please
Asked
Active
Viewed 36 times
0
-
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 Answers
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
- 412
- 3
- 14
-
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