質問編集履歴
3
タイトル変更
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
JSで一つ
|
1
|
+
JSで一つもファイル選択されなかったらエラーメッセージをアラート表示するという処理をしたい。
|
test
CHANGED
File without changes
|
2
コード追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,3 +1,83 @@
|
|
1
|
+
```html
|
2
|
+
|
3
|
+
<form action="check.php" method="post" name="send" enctype="multipart/form-data">
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
<div class="input-box">
|
8
|
+
|
9
|
+
<p class="title label-required">aaa.</p>
|
10
|
+
|
11
|
+
<input type="text" name="q01" value="a<?php if(isset($_GET['num'])) { $num = $_GET['num']; echo $num; } ?>" required="required">
|
12
|
+
|
13
|
+
</div>
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
<div class="input-box">
|
18
|
+
|
19
|
+
<p class="title label-required">bbb</p>
|
20
|
+
|
21
|
+
<input type="text" name="q02" value="a" required="required" style="ime-mode: inactive;">
|
22
|
+
|
23
|
+
</div>
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
======================================================================================================================
|
28
|
+
|
29
|
+
<div class="input-box">
|
30
|
+
|
31
|
+
<p class="title label-required">その他の商品画像(最大10点まで)</p>
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
<?php for ($loop = 0; $loop < 2; $loop++) { ?>
|
36
|
+
|
37
|
+
<div class="btn-files-wrap mb3">
|
38
|
+
|
39
|
+
<div class="btn-files btn02_<?php echo $loop; ?>">ファイルを選択</div>
|
40
|
+
|
41
|
+
<input type="file" name="q10<?php echo $loop; ?>" id="files02<?php echo $loop; ?>" accept="image/*">
|
42
|
+
|
43
|
+
<input id="filename02<?php echo $loop; ?>" value="" placeholder="選択されていません" readonly>
|
44
|
+
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<?php } ?>
|
48
|
+
|
49
|
+
</div>
|
50
|
+
|
51
|
+
======================================================================================================================
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
<div class="input-box">
|
56
|
+
|
57
|
+
<p class="title label-required">ccc</p>
|
58
|
+
|
59
|
+
<input type="text" name="q11" placeholder="例)クリスマスフェア" required="required" value="a">
|
60
|
+
|
61
|
+
</div>
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
<div class="next-btn">
|
66
|
+
|
67
|
+
<div class="link-box">
|
68
|
+
|
69
|
+
<p class="type-next" onClick="JavaScript:next_kantan()">確認画面へ<img src="common/img/icon_form_next.png" alt=""></p>
|
70
|
+
|
71
|
+
</div>
|
72
|
+
|
73
|
+
</div>
|
74
|
+
|
75
|
+
</form>
|
76
|
+
|
77
|
+
```
|
78
|
+
|
79
|
+
|
80
|
+
|
1
81
|
```js
|
2
82
|
|
3
83
|
if(document.send.q01.value == ""){alert('デザインNo.をご確認ください');frg = 1;return false}
|
1
コードの修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -3,18 +3,6 @@
|
|
3
3
|
if(document.send.q01.value == ""){alert('デザインNo.をご確認ください');frg = 1;return false}
|
4
4
|
|
5
5
|
else if(document.send.q02.value == ""){alert('店舗名をご入力ください');frg = 1;return false}
|
6
|
-
|
7
|
-
else if(document.send.q03.value == ""){alert('ご担当社名をご入力ください');frg = 1;return false}
|
8
|
-
|
9
|
-
else if(document.send.q04.value == ""){alert('納品先郵便番号をご入力ください');frg = 1;return false}
|
10
|
-
|
11
|
-
else if(document.send.q05.value == ""){alert('納品先住所をご入力ください');frg = 1;return false}
|
12
|
-
|
13
|
-
else if(document.send.q06.value == ""){alert('電話番号をご入力ください');frg = 1;return false}
|
14
|
-
|
15
|
-
else if(document.send.q17.value == ""){alert('E-mailアドレスをご入力ください');frg = 1;return false}
|
16
|
-
|
17
|
-
else if(document.send.q09.value == ""){alert('メインの商品画像を選択してください');frg = 1;return false}
|
18
6
|
|
19
7
|
===================================================================================================================
|
20
8
|
|
@@ -27,14 +15,6 @@
|
|
27
15
|
===================================================================================================================
|
28
16
|
|
29
17
|
else if(document.send.q11.value == ""){alert('メインタイトル(キャンペーン名)をご入力ください');frg = 1;return false}
|
30
|
-
|
31
|
-
else if(document.send.q12.value == ""){alert('開催期間・日時についてご入力ください');frg = 1;return false}
|
32
|
-
|
33
|
-
else if(document.send.q13.value == ""){alert('メインの商品についてご入力ください');frg = 1;return false}
|
34
|
-
|
35
|
-
else if(document.send.q14.value == ""){alert('その他掲載商品についてご入力ください');frg = 1;return false}
|
36
|
-
|
37
|
-
else if(document.send.q15.value == ""){alert('店舗情報をご入力ください');frg = 1;return false}
|
38
18
|
|
39
19
|
```
|
40
20
|
|