<script language="JavaScript">
<!--
function checkItem(theForm)
{
        if (theForm.s11.value == "" || theForm.s12.value == "") {
                alert("生徒氏名（漢字）は必ずご記入ください。");
                return false;
        }
        if (theForm.s13.value == "" || theForm.s14.value == "") {
                alert("生徒ふりがなは必ずご記入ください。");
                return false;
        }
        for (i = 0; i < theForm.s15.length && !theForm.s15[i].checked; i++) ;
        if (i == theForm.s15.length) {
                alert("生徒の性別は必ずお選びください。");
                return false;
        }
        if (theForm.s17.value == "" || theForm.s18.value == "-") {
                alert("学校名・学年は必ずご記入ください。");
                return false;
        }
        if (theForm.s20.value == "-") {
                alert("生徒への指導目的は必ずご記入ください。");
                return false;
        }
        if (theForm.p01.value == "" || theForm.p02.value == "") {
                alert("保護者氏名（漢字）は必ずご記入ください。");
                return false;
        }
        if (theForm.p03.value == "" || theForm.p04.value == "") {
                alert("保護者ふりがなは必ずご記入ください。");
                return false;
        }
        if (theForm.c01.value == "" && theForm.c02.value == "") {
                alert("電話番号または携帯番号は必ずご記入ください。");
                return false;
        }else if(theForm.c01.value){
       //電話番号フォーマットチェック
        txt = theForm.c01.value;
        data1 = txt.match(/^\d{2}-\d{4}-\d{4}$|^\d{10}$/);
        data2 = txt.match(/^\d{3}-\d{3}-\d{4}$|^\d{10}$/);
        data3 = txt.match(/^\d{4}-\d{2}-\d{4}$|^\d{10}$/);
        if(!(data1 || data2 || data3))  {
        alert("電話番号が不正です");
        return false;
        }
        }else{
        //携帯電話番号フォーマットチェック
        txt = theForm.c02.value;
        data4 = txt.match(/^\d{3}-\d{4}-\d{4}$|^\d{11}$/);
        if(!data4)  {
        alert("携帯電話番号が不正です");
        return false;
        }
        }
        if (theForm.a01.value == "" || theForm.a02.value == "") {
                alert("郵便番号は必ずご記入ください。");
                return false;
        }
        
        
        if (theForm.a03.value == "-" || theForm.a04.value == "" || theForm.a05.value == "") {
                alert("現住所は必ずご記入ください。");
                return false;
        }
        if (theForm.p05.value == "") {
                alert("ＰＣメールアドレスは必ずご記入ください。");
                return false;
        }

        return true;
}
// -->
</script>
