function check(){ if(window.confirm('削除してよろしいですか?')){ // 確認ダイアログを表示 return true; // 「OK」時は削除を実行 } else{ // 「キャンセル」時の処理 window.alert('キャンセルされました'); // 警告ダイアログを表示 return false; // 削除を中止 } } function input_check(){ var flag = 0; // 設定開始(必須にする項目を設定してください) if(document.fuzoku_club_input.title.value == ""){ // 「タイトル」の入力をチェック flag = 1; } else if(document.fuzoku_club_input.fuzoku_club_title.value == ""){ // 「大会名」の入力をチェック flag = 1; } else if(document.fuzoku_club_input.fuzoku_club_reg_user.value == ""){ // 「入力者」の入力をチェック flag = 1; } // 設定終了 if(flag){ window.alert('必須項目に未入力がありました'); // 入力漏れがあれば警告ダイアログを表示 return false; // 送信を中止 }else{ return true; // 送信を実行 } } //投稿チェック function validate(test){ return (test == (new Date(test).getFullYear() + "/" + (new Date(test).getMonth() + 1) + "/" + new Date(test).getDate())) ? true : false }; //投稿チェック function chk(type,mode){ if(type == 'norml'){ if(norml(mode)==''){ return false; } } } function norml(mode){ var arg = ""; var flg = ""; var n_str = ""; var a_str = ""; var b_str = ""; var c_str = ""; if(mode != 'edit'){ ttl = window.document.form1.title.value; d1 = window.document.form1.date1.value; d2 = window.document.form1.date2.value; d3 = window.document.form1.date3.value; }else{ ttl = document.getElementById("ttl").value; d1 = document.getElementById("d1").value; d2 = document.getElementById("d2").value; d3 = document.getElementById("d3").value; } if(ttl == ""){ arg = arg + '\n' + "タイトルを入力してください"; } if(d1 == "" || d2 == "" || d3 == ""){ arg = arg + '\n' + "日程を入力してください"; }else{ n_str = d1 + d2 + d3 if( n_str.match( /[^0-9:]+/ ) ) { arg = arg + "\n日程の数字は半角数字のみで入力してください。"; } } if(d1 > 2021){ arg = arg + "\n日程が現在から遠すぎます"; } if(d1 <= 2011){ if(d2 < 2){ arg = arg + "\n2011/02月以降管理"; } } if(d1 < 2011){ arg = arg + "\n2011/02月以降管理"; } var n1 = parseInt(d1); var n2 = parseInt(d2); var n3 = parseInt(d3); if(validate(n1+'/'+n2+'/'+n3)==false){ arg = arg + "\n存在しない日程です"; } if(arg != ""){ window.alert(arg); // 警告ダイアログを表示 return ''; }else{ return 'ok'; } }