回答編集履歴
2
ついき
test
CHANGED
@@ -21,3 +21,49 @@
|
|
21
21
|
</form>
|
22
22
|
|
23
23
|
```
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
# 追記
|
28
|
+
|
29
|
+
```javascript
|
30
|
+
|
31
|
+
<script>
|
32
|
+
|
33
|
+
$(function(){
|
34
|
+
|
35
|
+
$('form').on('submit',function(e){
|
36
|
+
|
37
|
+
var item=$(this).find('input').filter(function(){return $(this).val()=="";});
|
38
|
+
|
39
|
+
if(item.length>0){
|
40
|
+
|
41
|
+
e.preventDefault();
|
42
|
+
|
43
|
+
item.eq(0).trigger('focus');
|
44
|
+
|
45
|
+
}
|
46
|
+
|
47
|
+
});
|
48
|
+
|
49
|
+
});
|
50
|
+
|
51
|
+
</script>
|
52
|
+
|
53
|
+
<form>
|
54
|
+
|
55
|
+
<input type="text" name="a" value="123"><br>
|
56
|
+
|
57
|
+
<input type="text" name="b" value="456"><br>
|
58
|
+
|
59
|
+
<input type="text" name="c" value=""><br>
|
60
|
+
|
61
|
+
<input type="text" name="d" value="789"><br>
|
62
|
+
|
63
|
+
<input type="text" name="e" value="0ab"><br>
|
64
|
+
|
65
|
+
<input type="submit" value="send">
|
66
|
+
|
67
|
+
</form>
|
68
|
+
|
69
|
+
```
|
1
調整
test
CHANGED
@@ -8,13 +8,13 @@
|
|
8
8
|
|
9
9
|
<input type="text" name="a" value="123" required><br>
|
10
10
|
|
11
|
-
<input type="text" name="
|
11
|
+
<input type="text" name="b" value="456" required><br>
|
12
12
|
|
13
|
-
<input type="text" name="
|
13
|
+
<input type="text" name="c" value="" required><br>
|
14
14
|
|
15
|
-
<input type="text" name="
|
15
|
+
<input type="text" name="d" value="789" required><br>
|
16
16
|
|
17
|
-
<input type="text" name="
|
17
|
+
<input type="text" name="e" value="0ab" required><br>
|
18
18
|
|
19
19
|
<input type="submit" value="send">
|
20
20
|
|