/*-------------------------------------------------------------------------------------- 'プロシージャー名:call_db ' 機能:登録(修正/削除)ボタン押下時入力チェック/登録呼出 ' 引数:モード [1:登録、2:修正、3:削除、4:コピーして登録] '--------------------------------------------------------------------------------------*/ function call_db(db_flg){ var l_idx; var l_tancd = ""; var l_date = ""; var l_timeh = ""; var l_timem = ""; var l_ret; var l_len; if (db_flg == 0){ l_ret = confirm("キャンセルしてもよろしいですか?"); if (l_ret == false) { return; } } if (db_flg == 1){ l_idx = document.add20_01.TANCD.selectedIndex; l_tancd = document.add20_01.TANCD.options[l_idx].value; l_idx = document.add20_01.DATE_Y.selectedIndex; l_date = document.add20_01.DATE_Y.options[l_idx].text + "/"; l_idx = document.add20_01.DATE_M.selectedIndex; l_date = l_date + document.add20_01.DATE_M.options[l_idx].text + "/"; l_idx = document.add20_01.DATE_D.selectedIndex; l_date = l_date + document.add20_01.DATE_D.options[l_idx].text; l_idx = document.add20_01.TIME_H.selectedIndex; l_timeh = document.add20_01.TIME_H.options[l_idx].text; l_idx = document.add20_01.TIME_M.selectedIndex; l_timem = document.add20_01.TIME_M.options[l_idx].text; if (l_tancd == ""){ alert("ユーザーの登録がありません。"); Rtn=document.add20_01.TANCD.focus(); return; } if (CheckDate(l_date) == false){ alert("日付の指定に誤りがあります。"); Rtn=document.add20_01.DATE_D.focus(); return; } if (l_timeh == "--"){ alert("時刻が入力されていません。"); Rtn=document.add20_01.TIME_H.focus(); return; } if (l_timem == "--"){ alert("時刻が入力されていません。"); Rtn=document.add20_01.TIME_M.focus(); return; } if (Trim(document.add20_01.IRAINM.value) == ""){ alert("依頼人が入力されていません"); Rtn=document.add20_01.IRAINM.focus(); return; } l_len = data_length_get(Trim(document.add20_01.IRAINM.value)); if (l_len > 40){ alert(set_len_err_msg("依頼人", "40", l_len)); Rtn=document.add20_01.IRAINM.focus(); return; } // if ("" == document.add20_01.YOKENKBN.value) { // alert("用件をどれか一つ以上選択してください"); // Rtn=document.add20_01.YOKENKBN1.focus(); // return; // } l_len = data_length_get(Trim(document.add20_01.TEL.value)); if (l_len > 13){ alert(set_len_err_msg("電話番号", "13", l_len)); Rtn=document.add20_01.TEL.focus(); return; } l_len = data_length_get(Trim(document.add20_01.RETELDATE.value)); if (l_len > 30){ alert(set_len_err_msg("日時", "30", l_len)); Rtn=document.add20_01.RETELDATE.focus(); return; } l_len = data_length_get(Trim(document.add20_01.DENGON.value)); if (l_len > 500){ alert(set_len_err_msg("伝言", "500", l_len)); Rtn=document.add20_01.DENGON.focus(); return; } l_ret = confirm("登録してもよろしいですか?"); if (l_ret == false) { return; } } if (db_flg == 1){ document.add20_01.action="add20_db.asp"; }else{ document.add20_01.action="li10_01.asp"; } document.add20_01.submit(); } /*-------------------------------------------------------------------------------------- 'プロシージャー名:set_len_err_msg ' 機能:桁数オーバー時のエラーメッセージ作成 ' 引数:name :項目名 '         maxlen :最大桁数 '         l_len :入力桁数 '--------------------------------------------------------------------------------------*/ function set_len_err_msg(name, maxlen, l_len) { return name + "には半角("+ l_len +")文字が入力されています。\n"+ name +"の入力は半角("+ maxlen +")文字までです。" }