回答編集履歴
2
sample
test
CHANGED
@@ -3,23 +3,53 @@
|
|
3
3
|
|
4
4
|
# 置き換え例
|
5
5
|
```HTML
|
6
|
+
<style>
|
7
|
+
.select {
|
8
|
+
display:flex;
|
9
|
+
flex-direction : column;
|
10
|
+
padding:0;
|
11
|
+
height:5em;
|
12
|
+
overflow-y:scroll;
|
13
|
+
width:100px;
|
14
|
+
border:1px solid gray;
|
15
|
+
}
|
16
|
+
.select [type=checkbox] ~ span{
|
17
|
+
display:inline-block;
|
18
|
+
}
|
19
|
+
.select [type=checkbox]:checked ~ span{
|
20
|
+
background-Color:red;
|
21
|
+
}
|
22
|
+
.select [type=checkbox]{
|
23
|
+
display:none;
|
24
|
+
}
|
25
|
+
.select span{
|
26
|
+
font-size:0.8em;
|
27
|
+
list-style:none;
|
28
|
+
width:100%;
|
29
|
+
}
|
30
|
+
li{height:1em;}
|
31
|
+
</style>
|
6
32
|
<form>
|
7
33
|
<select name="ch[]" multiple>
|
8
|
-
<option value="">--</option>
|
9
34
|
<option value="1">1</option>
|
10
35
|
<option value="2">2</option>
|
11
36
|
<option value="3">3</option>
|
37
|
+
<option value="4">4</option>
|
38
|
+
<option value="5">5</option>
|
39
|
+
<option value="6">6</option>
|
12
40
|
</select>
|
13
41
|
<input type="submit" value="send">
|
14
42
|
</form>
|
15
|
-
↓↓↓
|
16
43
|
<form>
|
17
|
-
<ul>
|
44
|
+
<ul class="select">
|
18
|
-
<li><label><input type="checkbox" name="ch[]" value="">--</label>
|
19
|
-
<li><label><input type="checkbox" name="ch[]" value="1">1</label>
|
45
|
+
<li><label><input type="checkbox" name="ch[]" value="1"><span>1</span></label>
|
20
|
-
<li><label><input type="checkbox" name="ch[]" value="2">2</label>
|
46
|
+
<li><label><input type="checkbox" name="ch[]" value="2"><span>2</span></label>
|
21
|
-
<li><label><input type="checkbox" name="ch[]" value="3">3</label>
|
47
|
+
<li><label><input type="checkbox" name="ch[]" value="3"><span>3</span></label>
|
48
|
+
<li><label><input type="checkbox" name="ch[]" value="4"><span>4</span></label>
|
49
|
+
<li><label><input type="checkbox" name="ch[]" value="5"><span>5</span></label>
|
50
|
+
<li><label><input type="checkbox" name="ch[]" value="6"><span>6</span></label>
|
22
51
|
</ul>
|
23
52
|
<input type="submit" value="send">
|
24
53
|
</form>
|
54
|
+
|
25
55
|
```
|
1
test
CHANGED
@@ -1,2 +1,25 @@
|
|
1
1
|
multipleなselectでctrlをつかわないとなると何かを諦める必要があります
|
2
2
|
select風なチェックボックスにするなど工夫してみてください
|
3
|
+
|
4
|
+
# 置き換え例
|
5
|
+
```HTML
|
6
|
+
<form>
|
7
|
+
<select name="ch[]" multiple>
|
8
|
+
<option value="">--</option>
|
9
|
+
<option value="1">1</option>
|
10
|
+
<option value="2">2</option>
|
11
|
+
<option value="3">3</option>
|
12
|
+
</select>
|
13
|
+
<input type="submit" value="send">
|
14
|
+
</form>
|
15
|
+
↓↓↓
|
16
|
+
<form>
|
17
|
+
<ul>
|
18
|
+
<li><label><input type="checkbox" name="ch[]" value="">--</label>
|
19
|
+
<li><label><input type="checkbox" name="ch[]" value="1">1</label>
|
20
|
+
<li><label><input type="checkbox" name="ch[]" value="2">2</label>
|
21
|
+
<li><label><input type="checkbox" name="ch[]" value="3">3</label>
|
22
|
+
</ul>
|
23
|
+
<input type="submit" value="send">
|
24
|
+
</form>
|
25
|
+
```
|