Commit 59964145 by o.kimura

バリデートにblurを追加

parent a3e62071
Showing with 7 additions and 7 deletions
$(function () { $(function () {
$("#your_name").on("keydown keyup", function () { $("#your_name").on("keydown keyup blur", function () {
if ($(this).val() == "") { if ($(this).val() == "") {
$(".name_err").css("display", "block"); $(".name_err").css("display", "block");
$(".name_err").text("お名前が未入力です。") $(".name_err").text("お名前が未入力です。")
...@@ -13,7 +13,7 @@ $(function () { ...@@ -13,7 +13,7 @@ $(function () {
} }
}); });
$("#hurigana").on("keydown keyup", function () { $("#hurigana").on("keydown keyup blur", function () {
if ($(this).val() == "") { if ($(this).val() == "") {
$(".huri_err").css("display", "block"); $(".huri_err").css("display", "block");
$(".huri_err").text("フリガナが未入力です。") $(".huri_err").text("フリガナが未入力です。")
...@@ -26,7 +26,7 @@ $(function () { ...@@ -26,7 +26,7 @@ $(function () {
} }
}); });
$("#mail_add").on("keydown keyup", function () { $("#mail_add").on("keydown keyup blur", function () {
if ($(this).val() == "") { if ($(this).val() == "") {
$(".mail_add_err").css("display", "block"); $(".mail_add_err").css("display", "block");
$(".mail_add_err").text("メールアドレスが未入力です。"); $(".mail_add_err").text("メールアドレスが未入力です。");
...@@ -43,7 +43,7 @@ $(function () { ...@@ -43,7 +43,7 @@ $(function () {
} }
}); });
$("#mail_confirm").on("keydown keyup", function () { $("#mail_confirm").on("keydown keyup blur", function () {
if ($(this).val() == "") { if ($(this).val() == "") {
$(".add_confirm_err").css("display", "block"); $(".add_confirm_err").css("display", "block");
$(".add_confirm_err").text("確認用メールアドレスが未入力です。"); $(".add_confirm_err").text("確認用メールアドレスが未入力です。");
...@@ -64,7 +64,7 @@ $(function () { ...@@ -64,7 +64,7 @@ $(function () {
} }
}); });
$("#age").on("keydown keyup", function () { $("#age").on("keydown keyup blur", function () {
if ($(this).val() == "") { if ($(this).val() == "") {
$(".age_err").css("display", "block"); $(".age_err").css("display", "block");
$(".age_err").text("年齢が未入力です。"); $(".age_err").text("年齢が未入力です。");
...@@ -98,7 +98,7 @@ $(function () { ...@@ -98,7 +98,7 @@ $(function () {
} }
}); });
$("#addr").on("keydown keyup", function () { $("#addr").on("keydown keyup blur", function () {
if ($(this).val() == "") { if ($(this).val() == "") {
$(".add_err").css("display", "block"); $(".add_err").css("display", "block");
$(".add_err").text("住所が未入力です。") $(".add_err").text("住所が未入力です。")
...@@ -122,7 +122,7 @@ if ($(this).val().match(/^\d+$/)) { ...@@ -122,7 +122,7 @@ if ($(this).val().match(/^\d+$/)) {
} }
});*/ });*/
$("#content").on("keydown keyup", function () { $("#content").on("keydown keyup blur", function () {
if ($(this).val() == "") { if ($(this).val() == "") {
$(".question_err").css("display", "block"); $(".question_err").css("display", "block");
$(".question_err").text("ご意見・ご質問が未入力です。") $(".question_err").text("ご意見・ご質問が未入力です。")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment