$(function(){ //ご担当者名必須項目のチェック $("#nameVd").focusout(function(){ if($("#nameVd p.error").size() == 0){ $("#nameVd input").filter(".validate").each(function(){ //必須項目のチェック $(this).filter(".required01").each(function(){ if($(this).val()==""){ $(this).parent().prepend(""); $("#nameVd .error").show("slow"); } }); }); }else{ $("#nameVd input").filter(".validate").each(function(){ //必須項目のチェック $(this).filter(".required01").each(function(){ if($(this).val()==""){ }else{ $("#nameVd .error").hide("slow",function(){    $("#nameVd .error").remove(); }); } }); }) } }); //▼メールアドレス必須項目のチェック $("#emailVd").focusout(function(){     //▼必須項目のチェック if($("#emailVd p.error").size() == 0){ $("#emailVd input").filter(".validate").each(function(){ $(this).each(function(){ if($(this).val()==""){ $(this).parent().prepend(""); $("#emailVd .error").show("slow"); } }); }); }else{ $("#emailVd input").filter(".validate").each(function(){ //必須項目のチェック $(this).filter(".required02").each(function(){ if($(this).val()==""){ }else{ $("#emailVd p.error").hide("slow",function(){    $("#emailVd p.error").remove(); }); } }); }); } //▼メールアドレス入力内容のチェック if($("#emailVd p.error02").size() == 0){ $("#emailVd input").filter(".validate").each(function(){ $(this).filter(".mail").each(function(){ if($(this).val() && !$(this).val().match(/^[a-zA-Z0-9_\.\-]+?@[A-Za-z0-9_\.\-]+$/)){ $(this).parent().prepend(""); $("#emailVd .error02").show("slow"); } }); }); }else{ $("#emailVd input").filter(".validate").each(function(){ //メールアドレスのチェック $(this).filter(".mail").each(function(){ if($(this).val() && !$(this).val().match(/^[a-zA-Z0-9_\.\-]+?@[A-Za-z0-9_\.\-]+$/)){ }else{ $("#emailVd p.error02").hide("slow",function(){    $("#emailVd p.error02").remove(); }); } }); }); } }); //▲メールアドレス必須項目のチェック //▼チェックボックスのチェック $("#checkboxVd").change(function(){ //ひとつ以上入力されているかのチェック $(".checkboxRequired").each(function(){ if($(":checkbox:checked",this).size()==0){ $(this).prepend(""); $("#checkboxVd .error").show("slow"); }else{ $("#checkboxVd .error").hide("slow",function(){   $("#checkboxVd p.error").remove(); }); } }); }); //▲チェックボックスのチェック //▼電話番号のチェック $("#tellVd").focusout(function(){ if($("#tellVd p.error").size() > 0){ $("#tellVd input").filter(".validate").each(function(){ //電話番号のチェック $(this).filter(".tell").each(function(){ if($(this).val() && !$(this).val().match(/^[0-90-9|-]+$/)){ }else{ $("#tellVd .error").hide("slow",function(){ $("#tellVd .error").remove(); }); } }); }); } if($("#tellVd p.error").size() == 0){ $("#tellVd input").filter(".validate").each(function(){ //電話番号のチェック $(this).filter(".tell").each(function(){ if($(this).val() && !$(this).val().match(/^[0-90-9|-]+$/)){ $(this).parent().prepend(""); $("#tellVd .error").show("slow"); } }); }); } }); //▲電話番号のチェック /* submitクリック後の動作 オフィシャルサイト固有処理*/ $("#sendBtn").click(function(){ if ($('#check').prop('checked') == false) { } else { $('#formContent').submit(); } }); $(".error").show("slow"); });