質問編集履歴

1

html追加

2017/09/07 05:18

投稿

oldSatoimo
oldSatoimo

スコア21

test CHANGED
File without changes
test CHANGED
@@ -1,6 +1,8 @@
1
1
  日付の入力値チェックをした後、結果がNGならテキストボックスにフォーカスを当てた状態に戻したいのですが、うまくいきません。
2
2
 
3
3
  onchangeを使用しているのですが、どのように記載したら良いでしょうか。
4
+
5
+ HTMLはテーブルをループで10行出し、idは連番を振っています。
4
6
 
5
7
 
6
8
 
@@ -10,7 +12,7 @@
10
12
 
11
13
 
12
14
 
13
- ```
15
+ ```javascript
14
16
 
15
17
  <script>
16
18
 
@@ -113,3 +115,83 @@
113
115
  </script>
114
116
 
115
117
  ```
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+ ```html
126
+
127
+ <table border="1" style="border-collapse: collapse">
128
+
129
+ <%-- テーブルを10 出す --%>
130
+
131
+ <c:forEach var="loopCount" begin="1" end="10" step="1">
132
+
133
+ <tr>
134
+
135
+ <td align="center">
136
+
137
+ <%-- No --%>
138
+
139
+ <label for="idVoucherNo" style="width: 99%;"> <c:out
140
+
141
+ value="${loopCount}" />
142
+
143
+ </label>
144
+
145
+ </td>
146
+
147
+ <td>
148
+
149
+ <%-- DB処理日付 --%>
150
+
151
+ <c:if test="${exForm.searchFlag.equals('1') }">
152
+
153
+ <input type="text" name="nameDate" id="idDate${loopCount}"
154
+
155
+ tabindex="8" style="width: 99%; border: none;"
156
+
157
+ value="${exForm.searchList[loopCount-1].shorihiduke}"
158
+
159
+ onChange="expensesDateCheck(this,'md')" />
160
+
161
+ </c:if>
162
+
163
+ <%-- DBシステム日付 --%>
164
+
165
+ <c:if test="${!exForm.searchFlag.equals('1') }">
166
+
167
+ <input type="text" name="nameDate" id="idDate${loopCount}"
168
+
169
+ tabindex="8" style="width: 99%; border: none;"
170
+
171
+ value="${exForm.dateMmDd}"
172
+
173
+ onChange="expensesDateCheck(this,'md')" />
174
+
175
+ </c:if>
176
+
177
+ </td>
178
+
179
+ <td>
180
+
181
+ </td>
182
+
183
+ ~中略~
184
+
185
+ <td>
186
+
187
+ </td>
188
+
189
+ </tr>
190
+
191
+ </c:forEach>
192
+
193
+ </table>
194
+
195
+
196
+
197
+ ```