質問編集履歴

3

再度ソース追加

2021/12/15 01:27

投稿

com.woody
com.woody

スコア43

test CHANGED
File without changes
test CHANGED
@@ -20,6 +20,32 @@
20
20
 
21
21
  ```html
22
22
 
23
+ <script
24
+
25
+ src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"
26
+
27
+ integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
28
+
29
+ crossorigin="anonymous"
30
+
31
+ ></script>
32
+
33
+ <script
34
+
35
+ src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"
36
+
37
+ integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8="
38
+
39
+ crossorigin="anonymous"
40
+
41
+ ></script>
42
+
43
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap-validator@0.11.9/js/validator.min.js"></script>
44
+
45
+ ```
46
+
47
+ ```html
48
+
23
49
  <form class="form-horizontal" method="post" id="postform" onsubmit="return false;">
24
50
 
25
51
  <div class="panel panel-info">
@@ -151,3 +177,119 @@
151
177
  }
152
178
 
153
179
  ```
180
+
181
+ ```css
182
+
183
+
184
+
185
+ input[type="checkbox"] {
186
+
187
+ display: none;
188
+
189
+ }
190
+
191
+
192
+
193
+ input[type="checkbox"] + label.check {
194
+
195
+ position: relative;
196
+
197
+ cursor: pointer;
198
+
199
+ display: inline-block;
200
+
201
+ width: 70px;
202
+
203
+ height: 28px;
204
+
205
+ color: #969696;
206
+
207
+ border: 1px solid #a3a3a3;
208
+
209
+ border-radius: 3px;
210
+
211
+ background-color: #ffffff;
212
+
213
+ margin-top: 7px;
214
+
215
+ }
216
+
217
+
218
+
219
+ input[type="checkbox"]:checked + label.check {
220
+
221
+ border: 1px solid #4db4e4;
222
+
223
+ background-color: #4db4e4;
224
+
225
+ }
226
+
227
+
228
+
229
+ input[type="checkbox"] + label.check::before {
230
+
231
+ content: "固定日";
232
+
233
+ position: absolute;
234
+
235
+ top: 4px;
236
+
237
+ left: auto;
238
+
239
+ right: 6px;
240
+
241
+ }
242
+
243
+
244
+
245
+ input[type="checkbox"]:checked + label.check::before {
246
+
247
+ content: "営業日";
248
+
249
+ position: absolute;
250
+
251
+ left: 6px;
252
+
253
+ right: auto;
254
+
255
+ color: #ffffff;
256
+
257
+ }
258
+
259
+
260
+
261
+ input[type="checkbox"] + label.check > div {
262
+
263
+ position: absolute;
264
+
265
+ top: 2px;
266
+
267
+ left: 2px;
268
+
269
+ width: 12px;
270
+
271
+ height: 22px;
272
+
273
+ border: 1px solid #a3a3a3;
274
+
275
+ border-radius: 3px;
276
+
277
+ background-color: #ffffff;
278
+
279
+ transition: 0.2s;
280
+
281
+ }
282
+
283
+
284
+
285
+ input[type="checkbox"]:checked + label.check > div {
286
+
287
+ border: 1px solid transparent;
288
+
289
+ left: 54px;
290
+
291
+ }
292
+
293
+
294
+
295
+ ```

2

ソースを追加しました

2021/12/15 01:27

投稿

com.woody
com.woody

スコア43

test CHANGED
File without changes
test CHANGED
@@ -62,13 +62,13 @@
62
62
 
63
63
  <div class="col-sm-2 col-xs-4">
64
64
 
65
- <input class="form-control" type="text" name="year" />
65
+ <input class="form-control" type="text" name="year" required />
66
66
 
67
67
  </div>
68
68
 
69
69
  <div class="col-sm-2 col-xs-3">
70
70
 
71
- <input class="form-control" type="text" name="month" />
71
+ <input class="form-control" type="text" name="month" required />
72
72
 
73
73
  </div>
74
74
 

1

ソースを追加しました

2021/12/14 14:34

投稿

com.woody
com.woody

スコア43

test CHANGED
File without changes
test CHANGED
@@ -14,11 +14,47 @@
14
14
 
15
15
 
16
16
 
17
- レイアウトが崩れないようにコメントのdiv-formが生きるような修正方法をご教示いただきたいです。
17
+ レイアウトが崩れないように(真上にある年月のテキストフィールドと同じ幅になるように)コメントのdiv-formが生きるような修正方法をご教示いただきたいです。
18
18
 
19
19
 
20
20
 
21
21
  ```html
22
+
23
+ <form class="form-horizontal" method="post" id="postform" onsubmit="return false;">
24
+
25
+ <div class="panel panel-info">
26
+
27
+ <div class="panel-body">
28
+
29
+ <div class="form-group">
30
+
31
+ <label class="col-sm-2 col-xs-3 control-label" for="notify">通知方法</label>
32
+
33
+ <div class="col-sm-4 col-xs-9">
34
+
35
+ <select
36
+
37
+ class="form-control input-lg"
38
+
39
+ id="notify"
40
+
41
+ name="notify"
42
+
43
+ onchange="notifyChange()"
44
+
45
+ >
46
+
47
+ <option value="メール">メール</option>
48
+
49
+ <option value="タスク" selected>タスク</option>
50
+
51
+ </select>
52
+
53
+ </div>
54
+
55
+ </div>
56
+
57
+
22
58
 
23
59
  <div class="form-group">
24
60
 
@@ -74,4 +110,44 @@
74
110
 
75
111
  </div>
76
112
 
113
+ </div>
114
+
115
+ <div class="panel panel-plain">
116
+
117
+ <div class="panel-heading">
118
+
119
+ <div class="pull-right col-sm-3">
120
+
121
+ <button type="submit" class="btn btn-success btn-long pull-right" id="send_button">
122
+
123
+ <em class="fas fas-fw fa-check-circle">&nbsp;</em>登録
124
+
125
+ </button>
126
+
127
+ </div>
128
+
129
+ </div>
130
+
131
+ </div>
132
+
133
+ </div>
134
+
135
+ </form>
136
+
77
137
  ```
138
+
139
+ ```javascript
140
+
141
+ function notifyChange() {
142
+
143
+ if ($("#notify").val() == "タスク") {
144
+
145
+ $("#day").attr("required", true);
146
+
147
+ } else {
148
+
149
+ $("#day").attr("required", false);
150
+
151
+ }
152
+
153
+ ```