質問編集履歴
1
ソースを追加しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -7,3 +7,265 @@
|
|
7
7
|
ソースコード等が無くても構いません。こうしたらより見やすくなる、デザイン性がよくなる等助言お願い致します。
|
8
8
|
|
9
9
|
また、追加情報が必要でしたら随時更新いたします。
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
---
|
14
|
+
|
15
|
+
追記です。ソースを提示いたします。
|
16
|
+
|
17
|
+
JSが混在していたり見にくいとは思いますが、ご了承ください。
|
18
|
+
|
19
|
+
```JSP
|
20
|
+
|
21
|
+
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
22
|
+
|
23
|
+
pageEncoding="UTF-8"%>
|
24
|
+
|
25
|
+
<%@ page import="mastaProgram.Masta"%>
|
26
|
+
|
27
|
+
<%@ page import="java.util.ArrayList"%>
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
<!DOCTYPE html>
|
32
|
+
|
33
|
+
<html>
|
34
|
+
|
35
|
+
<head>
|
36
|
+
|
37
|
+
<meta charset="UTF-8">
|
38
|
+
|
39
|
+
<title>マスタメンテナンス</title>
|
40
|
+
|
41
|
+
<link href="TestMastaCSS.css" rel="stylesheet" type="text/css">
|
42
|
+
|
43
|
+
<script type="text/javascript" src="jquery-3.5.1.min.js"></script>
|
44
|
+
|
45
|
+
</head>
|
46
|
+
|
47
|
+
<body>
|
48
|
+
|
49
|
+
<%
|
50
|
+
|
51
|
+
ArrayList<Masta> masta = (ArrayList<Masta>) request.getAttribute("masta");
|
52
|
+
|
53
|
+
%>
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
<div class="all"><br>
|
60
|
+
|
61
|
+
<h2 class="center">従業員マスタメンテナンス</h2>
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
<form action="MastaServlet">
|
66
|
+
|
67
|
+
<p class="list">
|
68
|
+
|
69
|
+
全従業員リスト<input type="submit" value="表示" class="mastabutton">
|
70
|
+
|
71
|
+
</p>
|
72
|
+
|
73
|
+
</form>
|
74
|
+
|
75
|
+
<form action="TestMastaServlet">
|
76
|
+
|
77
|
+
従業員No.<input type="text" name="nom"size="1"><input type="submit"
|
78
|
+
|
79
|
+
value="検索"> <input type="submit" value="削除"
|
80
|
+
|
81
|
+
formaction="DeleteServlet"><br>
|
82
|
+
|
83
|
+
</form>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
<%
|
90
|
+
|
91
|
+
if (masta != null)
|
92
|
+
|
93
|
+
for (int i = 0; i < masta.size(); i++) {
|
94
|
+
|
95
|
+
Masta up = masta.get(i);
|
96
|
+
|
97
|
+
%>
|
98
|
+
|
99
|
+
<form action="UpdateServlet" method="post">
|
100
|
+
|
101
|
+
<p>
|
102
|
+
|
103
|
+
従業員No.<input type="text"value="<%=up.getNom()%>"name="nom" readonly size="1"></p>
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
<p>
|
108
|
+
|
109
|
+
生年月日(西暦):<input type="text" value="<%=up.getYear()%>" size="1"name="year" id="year2"style="ime-mode: inactive" onkeyup="get2()">年
|
110
|
+
|
111
|
+
<input type="text"value="<%=up.getMonth()%>"size="1" name="month" id="month" style="ime-mode: inactive" onkeyup="get2()">月
|
112
|
+
|
113
|
+
<input type="text" value="<%=up.getDay()%>" size="1"name="day" id="day" style="ime-mode: inactive" onkeyup="get2()">日
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
</p>
|
118
|
+
|
119
|
+
<p>
|
120
|
+
|
121
|
+
年齢:<input type="text"size="1" name="age" id="age2" value=<%=up.getAge()%>>歳
|
122
|
+
|
123
|
+
<script type="text/javascript" src="Nenrei2.js"></script>
|
124
|
+
|
125
|
+
</p>
|
126
|
+
|
127
|
+
<p>
|
128
|
+
|
129
|
+
氏名;<input type="text" value="<%=up.getName()%>" name="name"
|
130
|
+
|
131
|
+
style="ime-mode: active"> 氏名(かな):<input type="text"
|
132
|
+
|
133
|
+
value="<%=up.getKana()%>" name="kana" style="ime-mode: active">
|
134
|
+
|
135
|
+
</p>
|
136
|
+
|
137
|
+
<p>住所:〒<input type="text" value="<%=up.getCode() %>"size="6" name="code" id="code2" style="ime-mode: inactive"></p><br>
|
138
|
+
|
139
|
+
<input type="text" value="<%=up.getAdd1() %>" name="add1" id="add3"> <input type="text" value="<%=up.getAdd2() %>" name="add2" id="add4">
|
140
|
+
|
141
|
+
<script type="text/javascript" src="search2.js"></script>
|
142
|
+
|
143
|
+
<p>
|
144
|
+
|
145
|
+
メール<input type="text" value="<%=up.getMail()%>" name="mail"
|
146
|
+
|
147
|
+
style="ime-mode: inactive"> 電話<input type="text"
|
148
|
+
|
149
|
+
value="<%=up.getTell()%>" name="tell" style="ime-mode: inactive">
|
150
|
+
|
151
|
+
</p>
|
152
|
+
|
153
|
+
<br> <input type="submit" value="更新">
|
154
|
+
|
155
|
+
</form>
|
156
|
+
|
157
|
+
<%
|
158
|
+
|
159
|
+
}
|
160
|
+
|
161
|
+
else {
|
162
|
+
|
163
|
+
%>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
<form action="InputServlet" method="post">
|
168
|
+
|
169
|
+
<p>
|
170
|
+
|
171
|
+
生年月日(西暦):<input type="text" name="year" id="year" style="ime-mode: inactive" onkeyup="get()" placeholder="例)20200910" class="year"size="8">
|
172
|
+
|
173
|
+
<input type="text" name="age" id="age" size="1">歳
|
174
|
+
|
175
|
+
<script type="text/javascript" src="Nenrei.js"></script>
|
176
|
+
|
177
|
+
</p>
|
178
|
+
|
179
|
+
<p>
|
180
|
+
|
181
|
+
氏名<input type="text" name="name" style="ime-mode: active">
|
182
|
+
|
183
|
+
氏名(かな)<input type="text" name="kana" style="ime-mode: active">
|
184
|
+
|
185
|
+
</p>
|
186
|
+
|
187
|
+
<p>郵便番号<input type="text" name="code" id="code" style="ime-mode: inactive" size="6"><br>
|
188
|
+
|
189
|
+
住所<input type="text" name="add1" id="add1" size="4"><br>
|
190
|
+
|
191
|
+
<input type="text" name="add2" id="add2" size="30">
|
192
|
+
|
193
|
+
<script type="text/javascript" src="search.js"></script>
|
194
|
+
|
195
|
+
<p>メール<input type="text" name="mail" style="ime-mode: inactive">
|
196
|
+
|
197
|
+
電話<input type="text" name="tell" style="ime-mode: inactive">
|
198
|
+
|
199
|
+
</p>
|
200
|
+
|
201
|
+
<Input type="submit" value="新規登録">
|
202
|
+
|
203
|
+
</form>
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
<%
|
208
|
+
|
209
|
+
}
|
210
|
+
|
211
|
+
%>
|
212
|
+
|
213
|
+
<br>
|
214
|
+
|
215
|
+
</div>
|
216
|
+
|
217
|
+
<script>
|
218
|
+
|
219
|
+
$('form').on('keydown', 'input, button, select', function(e) {
|
220
|
+
|
221
|
+
if (e.keyCode == 13) {
|
222
|
+
|
223
|
+
if ($(this).attr("type") == 'submit') return;
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
var form = $(this).closest('form');
|
228
|
+
|
229
|
+
var focusable = form.find('input, button[type="submit"], select, textarea')
|
230
|
+
|
231
|
+
.not('[readonly]').filter(':visible');
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
if (e.shiftKey) {
|
236
|
+
|
237
|
+
focusable.eq(focusable.index(this) - 1).focus();
|
238
|
+
|
239
|
+
} else {
|
240
|
+
|
241
|
+
var next = focusable.eq(focusable.index(this) + 1);
|
242
|
+
|
243
|
+
if (next.length) {
|
244
|
+
|
245
|
+
next.focus();
|
246
|
+
|
247
|
+
} else {
|
248
|
+
|
249
|
+
focusable.eq(0).focus();
|
250
|
+
|
251
|
+
}
|
252
|
+
|
253
|
+
}
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
e.preventDefault();
|
258
|
+
|
259
|
+
}
|
260
|
+
|
261
|
+
});
|
262
|
+
|
263
|
+
</script>
|
264
|
+
|
265
|
+
</body>
|
266
|
+
|
267
|
+
</html>
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
```
|