質問編集履歴
1
情報追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -83,3 +83,147 @@
|
|
83
83
|
お忙しい中恐縮ですがアドバイスのほど頂戴できれば幸いです。
|
84
84
|
|
85
85
|
よろしくお願いいたします。
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
■現在のコード
|
92
|
+
|
93
|
+
```
|
94
|
+
|
95
|
+
<?php
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
if(isset($_POST["submit"]) AND isset($_POST["opinion"])){
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
$checked = "checked";
|
104
|
+
|
105
|
+
}
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
?>
|
110
|
+
|
111
|
+
<!doctype html>
|
112
|
+
|
113
|
+
<html lang="ja">
|
114
|
+
|
115
|
+
<head>
|
116
|
+
|
117
|
+
<meta charset="utf-8">
|
118
|
+
|
119
|
+
<title></title>
|
120
|
+
|
121
|
+
<script>
|
122
|
+
|
123
|
+
<!--
|
124
|
+
|
125
|
+
window.onload = function(){
|
126
|
+
|
127
|
+
document.getElementById("checkCmt").onclick = function(){
|
128
|
+
|
129
|
+
if (this.checked) {
|
130
|
+
|
131
|
+
document.getElementById("uComment").style.display = "block";
|
132
|
+
|
133
|
+
}else{
|
134
|
+
|
135
|
+
document.getElementById("uComment").style.display = "";
|
136
|
+
|
137
|
+
}
|
138
|
+
|
139
|
+
}
|
140
|
+
|
141
|
+
}
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
let check = function(){
|
148
|
+
|
149
|
+
let chbx = document.getElementById("checkCmt");
|
150
|
+
|
151
|
+
if (chbx.checked) {
|
152
|
+
|
153
|
+
document.getElementById("uComment").style.display = "block";
|
154
|
+
|
155
|
+
}else{
|
156
|
+
|
157
|
+
document.getElementById("uComment").style.display = "none";
|
158
|
+
|
159
|
+
}
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
}
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
window.onload = check;
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
document.getElementById("checkCmt").onclick = check;
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
-->
|
176
|
+
|
177
|
+
</script>
|
178
|
+
|
179
|
+
<style>
|
180
|
+
|
181
|
+
<!--
|
182
|
+
|
183
|
+
#uComment {
|
184
|
+
|
185
|
+
display:none;
|
186
|
+
|
187
|
+
}
|
188
|
+
|
189
|
+
-->
|
190
|
+
|
191
|
+
</style>
|
192
|
+
|
193
|
+
</head>
|
194
|
+
|
195
|
+
<body>
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
<form action="./test4.php" method="post" id="mainForm" name="mainForm">
|
204
|
+
|
205
|
+
<input type="checkbox" id="checkCmt" name="opinion" <?php echo $checked; ?>>意見を書く
|
206
|
+
|
207
|
+
<br />
|
208
|
+
|
209
|
+
<p id="uComment"><input type="text" name="Comment" value="<?php echo $Comment; ?>"></p>
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
<input type="submit" name="submit" value="submit">
|
214
|
+
|
215
|
+
</form>
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
</body>
|
226
|
+
|
227
|
+
</html>
|
228
|
+
|
229
|
+
```
|