質問編集履歴
1
コード(Class→Name)に変更。内容の簡略化
title
CHANGED
File without changes
|
body
CHANGED
@@ -11,54 +11,44 @@
|
|
11
11
|
### 該当のソースコード
|
12
12
|
```ここに言語名を入力
|
13
13
|
-----------以下、ラジオボタンA~Bに該当----------
|
14
|
-
@foreach($
|
14
|
+
@foreach($XXX as $id => $YYY)
|
15
|
-
|
15
|
+
<tr>
|
16
|
-
<td>
|
17
|
-
<label class="radio">
|
16
|
+
<label class="radio" name="choice1">
|
18
|
-
<input type="radio" name="
|
17
|
+
<input type="radio" name="A-NAME" value="{{$id}}"
|
19
18
|
@if($loop->first)
|
20
|
-
checked="checked"
|
21
19
|
@endif onclick="formSwitch()">
|
22
20
|
<span class="radio-icon"></span>
|
23
21
|
</label>
|
24
|
-
|
25
|
-
@if(!$loop->first)
|
26
|
-
<a href="{{route('A', $address->id)}}" class="btn btn-grey btn-block">編集</a>
|
27
|
-
@endif
|
28
|
-
</td>
|
29
|
-
|
22
|
+
</tr>
|
30
|
-
|
23
|
+
@endforeach
|
31
24
|
--------------------以下ラジオボタンC~Dに該当----------------------
|
32
25
|
|
33
|
-
|
26
|
+
<tr id="C">
|
34
|
-
|
27
|
+
<th>
|
35
28
|
<label class="radio" name="choice2">
|
36
|
-
<input type="radio" name="
|
29
|
+
<input type="radio" name="C-NAME" value="2">
|
37
30
|
<span class="radio-icon"></span>
|
38
31
|
</label>
|
39
|
-
|
32
|
+
|
40
|
-
|
33
|
+
</tr>
|
41
|
-
|
34
|
+
<tr id="D">
|
42
|
-
<th>
|
43
35
|
<label class="radio" name="choice3">
|
44
|
-
<input type="radio" name="
|
36
|
+
<input type="radio" name="D-NAME" value="3" >
|
45
37
|
<span class="radio-icon"></span>
|
46
38
|
</label>
|
47
|
-
</th>
|
48
|
-
|
39
|
+
</tr>
|
49
|
-
</table>
|
50
40
|
|
51
41
|
<script>
|
52
42
|
function formSwitch() {
|
53
|
-
hoge = document.getElementsByName('
|
43
|
+
hoge = document.getElementsByName('A-NAME')
|
54
44
|
if (hoge[0].checked) {
|
55
45
|
document.getElementById('C').style.display = "";
|
56
46
|
document.getElementById('D').style.display = "none";
|
57
|
-
document.
|
47
|
+
document.getElementByName('choice2').checked = "checked";
|
58
48
|
} else {
|
59
49
|
document.getElementById('C').style.display = "none";
|
60
50
|
document.getElementById('D').style.display = "";
|
61
|
-
document.
|
51
|
+
document.getElementByName('choice3').checked = "checked";
|
62
52
|
}
|
63
53
|
}
|
64
54
|
window.addEventListener('click', formSwitch);
|