回答編集履歴
1
追記
test
CHANGED
@@ -27,3 +27,15 @@
|
|
27
27
|
}
|
28
28
|
|
29
29
|
```
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
###余談
|
34
|
+
|
35
|
+
そもそもjQuery等をわざわざ使わなくとも、requiredを使えばブラウザ側で勝手に未入力を検知して送信を止めてくれます。まあ、ブラウザによって動作が異なるので自力でやるのが確実ではありますが。
|
36
|
+
|
37
|
+
[http://www.w3schools.com/tags/att_input_required.asp](http://www.w3schools.com/tags/att_input_required.asp)
|
38
|
+
|
39
|
+
ついでに、patternを使えば「数字だけ」「英語だけ」「電話番号の形式だけ」「メールアドレスの形式だけ」等の制限もjQueryなしでつけれます。
|
40
|
+
|
41
|
+
[http://www.w3schools.com/tags/att_input_pattern.asp](http://www.w3schools.com/tags/att_input_pattern.asp)
|