/////////////////////////////////////////////////////////////////////////////////////////// /** * 項目タイプと属性を指定して入力値をチェックします。 * 正常な場合trueを返します。 * 詳細は【JavaScript定義】を参照下さい。 */ var HANKAKU_KANA_VAL = ""; var HANKAKU_SUJI_VAL = ""; var HANKAKU_EIJI_VAL = ""; var ZENKAKU_KANA_VAL = ""; var ZENKAKU_SUJI_VAL = ""; var ZENKAKU_EIJI_VAL = ""; var MARK1_VAL = ""; var MARK2_VAL = ""; var MARK3_VAL = ""; var DISABLECHARS = ""; function init(){ HANKAKU_KANA_VAL = "アァイィウゥエェオォカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン゚゙ャュョ"; HANKAKU_SUJI_VAL = "1234567890"; HANKAKU_EIJI_VAL = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; ZENKAKU_KANA_VAL = " アァイィウゥエェオォカガキギクグケゲコゴサザシジスズセゼソゾ" + "タダチヂツッヅテデトドナニヌネノハバパヒビピフブプヘベペホボポ" + "マミムメモヤャユュヨョラリルレロワヲンヴー−."; ZENKAKU_SUJI_VAL = "0123456789"; ZENKAKU_EIJI_VAL = " AaBbCcDdEeFfGgHhIiJjKkLlMmNnOo" + "PpQqRrSsTtUuVvWwXxYyZz"; MARK1_VAL = " ー−.-"; MARK2_VAL = " ()() "; MARK3_VAL = "<>'\"?&"; /** * 入力できない文字(952文字) * (SJIS 0x8740から0x87FF 及び 0xED40以降) */ DISABLECHARS = ""; } function inputCheck(checkType, maxLength, isRequired, nFieldName, fieldName1, fieldName2, fieldName3, fieldName4){ init(); // リターンコードを格納する変数 var chk_flg = true; // チェックする変数内の値を格納する変数 var str = ""; //日付、郵便番号はmaxLengthが固定 if (checkType == "8") maxLength = 8; if (checkType == "12") maxLength = 7; //項目固有のチェックから行う。 switch (checkType){ case "2": //半角英数字チェック if (!Hankaku_EijiSuji_chk(fieldName1, nFieldName)) chk_flg = false; // maxlengthチェック用に値の取得を行う。 str = eval("document.form1." + fieldName1 + ".value"); break; case "3": //半角数字チェック if (!Hankaku_Suji_chk(fieldName1, nFieldName)) chk_flg = false; // maxlengthチェック用に値の取得を行う。 str = eval("document.form1." + fieldName1 + ".value"); break; case "4": //全角チェック if (!Zenkaku_chk(fieldName1, nFieldName)) chk_flg = false; // maxlengthチェック用に値の取得を行う。 str = eval("document.form1." + fieldName1 + ".value"); break; case "5": //全角カタカナチェック if (!Zenkaku_Kana_chk(fieldName1, nFieldName)) chk_flg = false; // maxlengthチェック用に値の取得を行う。 str = eval("document.form1." + fieldName1 + ".value"); break; case "7": //カタカナ英数字記号チェック if (!KanaEijiSujiMark_chk(fieldName1, nFieldName)) chk_flg = false; // maxlengthチェック用に値の取得を行う。 str = eval("document.form1." + fieldName1 + ".value"); break; case "8": //日付チェック if (!Date_chk(fieldName1, fieldName2, fieldName3, nFieldName)) chk_flg = false; // maxlengthチェック用に値の取得を行う。 fieldvalue1 = eval("document.form1." + fieldName1 + ".value"); fieldvalue2 = eval("document.form1." + fieldName2 + ".value"); fieldvalue3 = eval("document.form1." + fieldName3 + ".value"); str = fieldvalue1 + fieldvalue2 + fieldvalue3; break; case "9": //プルダウンチェック if (!PullDown_chk(fieldName1, nFieldName)) chk_flg = false; n = eval("document.form1." + fieldName1 + ".selectedIndex"); str = eval("document.form1." + fieldName1 + "[" + n + "].value"); break; case "10": //ラジオボタンチェック if (!Radio_chk(fieldName1, nFieldName)) chk_flg = false; break; case "11": //メールアドレスチェック if (!Mail_chk(fieldName1, fieldName2, nFieldName)) chk_flg = false; // maxlengthチェック用に値の取得を行う。 fieldvalue1 = eval("document.form1." + fieldName1 + ".value"); fieldvalue2 = eval("document.form1." + fieldName2 + ".value"); str = fieldvalue1 + fieldvalue2; break; case "12": //郵便番号チェック if (!ZipCode_chk(fieldName1, fieldName2, nFieldName)) chk_flg = false; // maxlengthチェック用に値の取得を行う。 fieldvalue1 = eval("document.form1." + fieldName1 + ".value"); fieldvalue2 = eval("document.form1." + fieldName2 + ".value"); str = fieldvalue1 + fieldvalue2; break; case "13": //電話番号チェック(携帯電話番号不可) if (!Tel_chk1(fieldName1, fieldName2, fieldName3, nFieldName,isRequired)) chk_flg = false; // maxlengthチェック用に値の取得を行う。 fieldvalue1 = eval("document.form1." + fieldName1 + ".value"); fieldvalue2 = eval("document.form1." + fieldName2 + ".value"); fieldvalue3 = eval("document.form1." + fieldName3 + ".value"); str = fieldvalue1 + fieldvalue2 + fieldvalue3; break; case "14": //携帯電話番号チェック if (!KTel_chk(fieldName1, fieldName2, fieldName3, nFieldName,isRequired)) chk_flg = false; // maxlengthチェック用に値の取得を行う。 fieldvalue1 = eval("document.form1." + fieldName1 + ".value"); fieldvalue2 = eval("document.form1." + fieldName2 + ".value"); fieldvalue3 = eval("document.form1." + fieldName3 + ".value"); str = fieldvalue1 + fieldvalue2 + fieldvalue3; break; //2003.12.24 add start case "15": //パスワードチェック if (!Password_chk(fieldName1, nFieldName)) chk_flg = false; // maxlengthチェック用に値の取得を行う。 str = eval("document.form1." + fieldName1 + ".value"); break; //2003.12.24 add end case "18": //同値チェック if (!Equal_chk(fieldName1, fieldName2, nFieldName)) chk_flg = false; str = eval("document.form1." + fieldName1 + ".value"); break; case "20": //半角入力不可文字チェック if (!Hankaku_DisableChars_chk(fieldName1, nFieldName)) chk_flg = false; str = eval("document.form1." + fieldName1 + ".value"); break; case "21": //電話番号チェック(携帯電話番号可) if (!Tel_chk2(fieldName1, fieldName2, fieldName3, nFieldName,isRequired)) chk_flg = false; // maxlengthチェック用に値の取得を行う。 fieldvalue1 = eval("document.form1." + fieldName1 + ".value"); fieldvalue2 = eval("document.form1." + fieldName2 + ".value"); fieldvalue3 = eval("document.form1." + fieldName3 + ".value"); str = fieldvalue1 + fieldvalue2 + fieldvalue3; break; //2007.02.28 菅原 追加 case "22": // メールアドレスチェック2 str = eval("document.form1." + fieldName1 + ".value"); if (!Mail_chk2(fieldName1, nFieldName)) chk_flg = false; strToken = eval("document.form1." + fieldName1 + ".value"); index = strToken.indexOf("@"); fieldvalue1 = strToken.substring(0, index); fieldvalue2 = strToken.substring(index + 1, strToken.length); str = fieldvalue1 + fieldvalue2; break; case "25": // ID・メルアドチェック str = eval("document.form1." + fieldName1 + ".value"); if (str.indexOf("@") < 0) { // IDが入力された場合は半角英数字チェック if (!Hankaku_EijiSuji_chk(fieldName1, nFieldName)) chk_flg = false; } else { // メルアドが入力された場合はメルアドチェック if (!Mail_chk2(fieldName1, nFieldName)) chk_flg = false; strToken = eval("document.form1." + fieldName1 + ".value"); index = strToken.indexOf("@"); fieldvalue1 = strToken.substring(0, index); fieldvalue2 = strToken.substring(index + 1, strToken.length); str = fieldvalue1 + fieldvalue2; } break; case "26": // メールアドレスチェック3 str = eval("document.form1." + fieldName1 + ".value"); if (!Mail_chk3(fieldName1, nFieldName)) chk_flg = false; strToken = eval("document.form1." + fieldName1 + ".value"); index = strToken.indexOf("@"); fieldvalue1 = strToken.substring(0, index); fieldvalue2 = strToken.substring(index + 1, strToken.length); str = fieldvalue1 + fieldvalue2; break; default: break; } if (!chk_flg) return false; // 項目固有処理でエラーであれば終了する。 // プルダウンとラジオボタン以外の時のみチェックする。 if (!((checkType == "9") || (checkType == "10"))){ // 共通的なチェックを行う。 // 必須入力チェック if (isRequired) { if (!Required_chk(str)) { showAlert("MSGC00010", fieldName1, nFieldName); return false; } } if (!startWithBlank(str)) { showAlert("MSGC00020", fieldName1, nFieldName); return false; } } var nMaxLength = -1; // if(isNaN(maxLength)){ // alert("デバッグ:maxLengthは数値で指定されていません"); // nMaxLength = parseInt(maxLength); // } // else{ // alert("1"); nMaxLength = parseInt(maxLength); // alert("2"); // } // alert("nMaxLength: " + nMaxLength + ", isNaN():" + isNaN(nMaxLength)); // maxLengthチェック //if (maxLength != -1) { if (nMaxLength != -1) { //if (!MaxLength_chk(checkType, str, fieldName1, nFieldName, maxLength)) return false; if (!MaxLength_chk(checkType, str, fieldName1, nFieldName, nMaxLength)) return false; } return chk_flg; } /** * 指定のメッセージコードでalertを表示し、項目にカーソルを移動します。 * changeVal1およびchangeVal2に指定した文字をメッセージに埋め込みます。 */ function showAlert(errorCode, fieldName, changeVal1, changeVal2){ alertMessage(errorCode,changeVal1,changeVal2); var item = "document.form1." + fieldName +".value"; // ラジオボタンの時はfieldName[n]としないと"undefined"になるので、フォーカスを当てない事にした。 if (typeof eval(item) != "undefined"){ var item = "document.form1." + fieldName +".focus()"; eval(item); } } /** * 文字が入力されているかどうかチェックします。 */ function Required_chk(str){ if (str.length == 0) return false; else return true; } /** * 空白文字で始まる場合、falseを返します。 */ function startWithBlank(str){ if (str.length == 0) return true; else { if (str.charAt(0) == " " ||str.charAt(0) == " ") return false; return true; } } /** * 最大入力文字数を超えていないかチェックします。 */ function MaxLength_chk(checkType, str, fieldName, nFieldName, maxLength){ if (str.length == 0) return true; if (str.length > maxLength) { showAlert("MSGC00030", fieldName, nFieldName, maxLength); return false; } return true; } /** * 半角英数字かどうかをチェックします。 * 全て半角英数字であればtrueを返します。 */ function Hankaku_EijiSuji_chk(fieldName1, nFieldName){ str = eval("document.form1." + fieldName1 + ".value"); if (!inner_Hankaku_EijiSuji_chk(str)) { showAlert("MSGC00050", fieldName1, nFieldName); return false; } return true; } /** * 半角数字かどうかをチェックします。 * 全て半角数字であればtrueを返します。 */ function Hankaku_Suji_chk(fieldName1, nFieldName){ str = eval("document.form1." + fieldName1 + ".value"); if (!inner_Hankaku_Suji_chk(str)) { showAlert("MSGC00060", fieldName1, nFieldName); return false; } return true; } /** * 全角かどうかをチェックします。 * 全て全角であればtrueを返します。 */ function Zenkaku_chk(fieldName1, nFieldName){ str = eval("document.form1." + fieldName1 + ".value"); if (!inner_DisableChars_chk(str)) { showAlert("MSGC00310", fieldName1, nFieldName); return false; } if (!inner_Zenkaku_chk(str)) { showAlert("MSGC00070", fieldName1, nFieldName); return false; } return true; } /** * 全角カナかどうかをチェックします。 * 全て全角カナであればtrueを返します。 */ function Zenkaku_Kana_chk(fieldName1, nFieldName){ str = eval("document.form1." + fieldName1 + ".value"); if (!inner_Zenkaku_Kana_chk(str)) { showAlert("MSGC00080", fieldName1, nFieldName); return false; } return true; } /** * カナまたは英字または数字または記号かどうかをチェックします。 * 全てカナまたは英字または数字または記号であればtrueを返します。 */ function KanaEijiSujiMark_chk(fieldName1, nFieldName){ str = eval("document.form1." + fieldName1 + ".value"); if (!inner_KanaEijiSujiMark_chk(str)) { showAlert("MSGC00100", fieldName1, nFieldName); return false; } return true; } /** * 有効な日付値かどうかをチェックします。 * 有効な日付値であればtrueを返します。 * また、月および日の前ゼロ補完を自動で行います。 */ function Date_chk(fieldName1, fieldName2, fieldName3, nFieldName){ fieldvalue1 = eval("document.form1." + fieldName1 + ".value"); fieldvalue2 = eval("document.form1." + fieldName2 + ".value"); fieldvalue3 = eval("document.form1." + fieldName3 + ".value"); if ((fieldvalue1 != "") || (fieldvalue2 != "") || (fieldvalue3 != "")){ if (fieldvalue1 == ""){ showAlert("MSGC00130", fieldName1, nFieldName, "年"); return false; } if (fieldvalue2 == ""){ showAlert("MSGC00130", fieldName2, nFieldName, "月"); return false; } if (fieldvalue3 == ""){ showAlert("MSGC00130", fieldName3, nFieldName, "日"); return false; } // 月の前ゼロ補完 if (fieldvalue2.length <= 1) fieldvalue2 = '0' + fieldvalue2; // 日の前ゼロ補完 if (fieldvalue3.length <= 1) fieldvalue3 = '0' + fieldvalue3; str = fieldvalue1 + fieldvalue2 + fieldvalue3; if (!inner_Date_chk(str)) { showAlert("MSGC00110", fieldName1, nFieldName); return false; } var valueChenge = "document.form1." + fieldName2 + ".value=" + "'" + fieldvalue2 + "'"; eval(valueChenge); var valueChenge = "document.form1." + fieldName3 + ".value=" + "'" + fieldvalue3 + "'"; eval(valueChenge); } return true; } /** * プルダウンの先頭項目以外が選択されているかどうかをチェックします。 * 先頭項目以外が選択されていればtrueを返します。 * 先頭項目の値は必ず""であり、他の選択肢に""がないものします。 */ function PullDown_chk(fieldName1, nFieldName){ //alert("PullDown_chk() come"); //str = eval("document.form1." + fieldName1 + ".value"); //alert("str: " + str); //alert("PullDown_chk() come"); //str = eval("document.form1." + fieldName1 + ".value"); n = eval("document.form1." + fieldName1 + ".selectedIndex"); str = eval("document.form1." + fieldName1 + "[" + n + "].value"); if (str == "" || str == null) { showAlert("MSGC00120", fieldName1, nFieldName); return false; } return true; } /** * ラジオボタンが選択されているかどうかをチェックします。 * ラジオボタンが選択されていればtrueを返します。 */ function Radio_chk(fieldName1, nFieldName){ if (!inner_Radio_chk(fieldName1)) { showAlert("MSGC00120", fieldName1, nFieldName); return false; } return true; } /** * 有効なメールアドレスかどうかをチェックします。 * 有効なメールアドレスであればtrueを返します。 * 実際に存在するドメインorユーザであるかはチェックしません。 */ function Mail_chk(fieldName1, fieldName2, nFieldName){ fieldvalue1 = eval("document.form1." + fieldName1 + ".value"); fieldvalue2 = eval("document.form1." + fieldName2 + ".value"); str = fieldvalue1 + fieldvalue2; if ((fieldvalue1 == "") && (fieldvalue2 != "")){ showAlert("MSGC00140", fieldName1, nFieldName); return false; } if (!inner_Hankaku_chk(fieldvalue1)){ showAlert("MSGC00150", fieldName1, nFieldName); return false; } if (!inner_Hankaku_Kana_chk(fieldvalue1)){ showAlert("MSGC00150", fieldName1, nFieldName); return false; } if (!inner_Hankaku_DisableChars_chk(fieldvalue1)){ showAlert("MSGC00320", fieldName1, nFieldName); return false; } if (fieldvalue1.length != 0){ f_quest = fieldvalue1.indexOf("@") if ( f_quest != -1) { showAlert("MSGC00170", fieldName1, nFieldName); return false; } } if (fieldvalue1.length != 0){ f_quest = fieldvalue1.indexOf(",") if ( f_quest != -1) { showAlert("MSGC00180", fieldName1, nFieldName); return false; } } if (fieldvalue1.length != 0){ f_quest = fieldvalue1.indexOf(" ") if ( f_quest != -1) { showAlert("MSGC00190", fieldName1, nFieldName); return false; } } if ((fieldvalue2 == "") && (fieldvalue1 != "")){ showAlert("MSGC00140", fieldName2, nFieldName); return false; } if (!inner_Hankaku_chk(fieldvalue2)){ showAlert("MSGC00150", fieldName2, nFieldName); return false; } if (!inner_Hankaku_Kana_chk(fieldvalue2)){ showAlert("MSGC00150", fieldName2, nFieldName); return false; } if (!inner_Hankaku_DisableChars_chk(fieldvalue2)){ showAlert("MSGC00320", fieldName2, nFieldName); return false; } if (fieldvalue2.length != 0){ f_quest = fieldvalue2.indexOf(".") f_length = fieldvalue2.length-1 if ( f_quest == 0 || f_quest == -1 || f_quest == f_length ){ showAlert("MSGC00200", fieldName2, nFieldName); return false; } } if (fieldvalue2.length != 0){ f_quest = fieldvalue2.indexOf("@") if ( f_quest != -1) { showAlert("MSGC00170", fieldName2, nFieldName); return false; } } if (fieldvalue2.length != 0){ f_quest = fieldvalue2.indexOf(",") if ( f_quest != -1) { showAlert("MSGC00180", fieldName2, nFieldName); return false; } } if (fieldvalue2.length != 0){ var_lastchar = fieldvalue2.charAt(f_length) if ( var_lastchar == "." ) { showAlert("MSGC00210", fieldName2, nFieldName); return false; } } if (fieldvalue2.length != 0){ f_quest = fieldvalue2.indexOf(" ") if ( f_quest != -1) { showAlert("MSGC00190", fieldName2, nFieldName); return false; } } // jp-○.ne.jp は不可 if(fieldvalue2.length == 10){ var val = fieldvalue2.toLowerCase(); if("jp-" == val.substr(0,3)){ if(".ne.jp" == val.substr(4,6)){ showAlert("MSGC00380", fieldName2, nFieldName); return false; } } } // .. は不可 for(var i = 0; i < fieldvalue2.length - 1; i++){ if(".." == fieldvalue2.substr(i,2)){ showAlert("MSGC00370", fieldName2, nFieldName); return false; } } return true; } //2007.02.28 菅原 追加 /** * 有効なメールアドレスかどうかをチェックします。 * 有効なメールアドレスであればtrueを返します。 * 実際に存在するドメインorユーザであるかはチェックしません。 */ function Mail_chk2(fieldName1, nFieldName){ strToken = eval("document.form1." + fieldName1 + ".value"); fieldvalue1 = ""; fieldvalue2 = ""; index = strToken.indexOf("@"); fieldvalue1 = strToken.substring(0, index); if ((index + 1) < strToken.length) { fieldvalue2 = strToken.substring(index + 1, strToken.length); } str = fieldvalue1 + fieldvalue2; if (fieldvalue1 == ""){ showAlert("MSGC00140", fieldName1, nFieldName); return false; } if (!inner_Hankaku_chk(fieldvalue1)){ showAlert("MSGC00150", fieldName1, nFieldName); return false; } if (!inner_Hankaku_Kana_chk(fieldvalue1)){ showAlert("MSGC00150", fieldName1, nFieldName); return false; } if (!inner_Hankaku_DisableChars_chk(fieldvalue1)){ showAlert("MSGC00320", fieldName1, nFieldName); return false; } if (fieldvalue1.length != 0){ f_quest = fieldvalue1.indexOf("@") if ( f_quest != -1) { showAlert("MSGC00170", fieldName1, nFieldName); return false; } } if (fieldvalue1.length != 0){ f_quest = fieldvalue1.indexOf(",") if ( f_quest != -1) { showAlert("MSGC00180", fieldName1, nFieldName); return false; } } if (fieldvalue1.length != 0){ f_quest = fieldvalue1.indexOf(" ") if ( f_quest != -1) { showAlert("MSGC00190", fieldName1, nFieldName); return false; } } if (fieldvalue2 == ""){ showAlert("MSGC00140", fieldName1, nFieldName); return false; } if (!inner_Hankaku_chk(fieldvalue2)){ showAlert("MSGC00150", fieldName1, nFieldName); return false; } if (!inner_Hankaku_Kana_chk(fieldvalue2)){ showAlert("MSGC00150", fieldName1, nFieldName); return false; } if (!inner_Hankaku_DisableChars_chk(fieldvalue2)){ showAlert("MSGC00320", fieldName1, nFieldName); return false; } if (fieldvalue2.length != 0){ f_quest = fieldvalue2.indexOf(".") f_length = fieldvalue2.length-1 if ( f_quest == 0 || f_quest == -1 || f_quest == f_length ){ showAlert("MSGC00200", fieldName1, nFieldName); return false; } } if (fieldvalue2.length != 0){ f_quest = fieldvalue2.indexOf("@") if ( f_quest != -1) { showAlert("MSGC00170", fieldName1, nFieldName); return false; } } if (fieldvalue2.length != 0){ f_quest = fieldvalue2.indexOf(",") if ( f_quest != -1) { showAlert("MSGC00180", fieldName1, nFieldName); return false; } } if (fieldvalue2.length != 0){ var_lastchar = fieldvalue2.charAt(f_length) if ( var_lastchar == "." ) { showAlert("MSGC00210", fieldName1, nFieldName); return false; } } if (fieldvalue2.length != 0){ f_quest = fieldvalue2.indexOf(" ") if ( f_quest != -1) { showAlert("MSGC00190", fieldName1, nFieldName); return false; } } // 携帯メールアドレスは不可 var val = fieldvalue2.toLowerCase(); if ( val == "docomo.ne.jp" || val == "sky.tu-ka.ne.jp" || val == "sky.tkk.ne.jp" || val == "sky.tkc.ne.jp"){ showAlert("MSGC00390", fieldName1, nFieldName); return false; } else { if ((-1 != val.lastIndexOf(".vodafone.ne.jp")) || (-1 != val.lastIndexOf("ido.ne.jp")) || (-1 != val.lastIndexOf("ezweb.ne.jp")) || (-1 != val.lastIndexOf("softbank.ne.jp"))) { showAlert("MSGC00390", fieldName1, nFieldName); return false; }else if(fieldvalue2.length == 10){ if("jp-" == val.substr(0,3)){ if(".ne.jp" == val.substr(4,6)){ showAlert("MSGC00390", fieldName1, nFieldName); return false; } } } } // .. は不可 for(var i = 0; i < fieldvalue2.length - 1; i++){ if(".." == fieldvalue2.substr(i,2)){ showAlert("MSGC00370", fieldName1, nFieldName); return false; } } return true; } /** * 有効な郵便番号かどうかをチェックします。 * 有効な郵便番号であればtrueを返します。 * 実際に存在する郵便番号であるかはチェックしません。 */ function ZipCode_chk(fieldName1, fieldName2, nFieldName){ fieldvalue1 = eval("document.form1." + fieldName1 + ".value"); fieldvalue2 = eval("document.form1." + fieldName2 + ".value"); str = fieldvalue1 + fieldvalue2; if (!Hankaku_Suji_chk(fieldName1, nFieldName)){ return false; } if ((fieldvalue1 != "") || (fieldvalue2 != "")){ if (fieldvalue1.length != 3){ showAlert("MSGC00160", fieldName1, nFieldName); return false; } if (fieldvalue2.length != 4){ showAlert("MSGC00160", fieldName2, nFieldName); return false; } } if (fieldvalue1 =="000"){ ; showAlert("MSGC00230", fieldName1, nFieldName); return false; } if (!Hankaku_Suji_chk(fieldName2, nFieldName)){ return false; } return true; } /** * 有効な電話番号かどうかをチェックします。(携帯電話番号不可) * 有効な電話番号であればtrueを返します。 */ function Tel_chk1(fieldName1, fieldName2, fieldName3, nFieldName,isRequired){ fieldvalue1 = eval("document.form1." + fieldName1 + ".value"); fieldvalue2 = eval("document.form1." + fieldName2 + ".value"); fieldvalue3 = eval("document.form1." + fieldName3 + ".value"); str = fieldvalue1 + fieldvalue2 + fieldvalue3; if (isRequired){ if (fieldvalue1 == ""){ showAlert("MSGC00130", fieldName1, nFieldName, "市外局番"); return false; } } if (!Hankaku_Suji_chk(fieldName1, nFieldName)){; return false; } if (fieldvalue1 != ""){ var chk_cd1 = fieldvalue1.substring(0,1); if (chk_cd1 !="0"){ ; showAlert("MSGC00240", fieldName1, nFieldName); return false; } if(!zero_chk(fieldvalue1)){ showAlert("MSGC00140", fieldName1, nFieldName); return false; } var chk_cd2 = fieldvalue1.substring(2,3); if (chk_cd2 == "0"){ ; showAlert("MSGC00250", fieldName1, nFieldName); return false; } } if (isRequired){ if (fieldvalue2 == ""){ showAlert("MSGC00130", fieldName2, nFieldName, "市内局番"); return false; } } if (!Hankaku_Suji_chk(fieldName2, nFieldName)){; return false; } if(!zero_chk(fieldvalue2)){ showAlert("MSGC00140", fieldName2, nFieldName); return false; } if (isRequired){ if (fieldvalue3 == ""){ showAlert("MSGC00130", fieldName3, nFieldName, "加入者番号"); return false; } } if (!Hankaku_Suji_chk(fieldName3, nFieldName)){; return false; } if(!zero_chk(fieldvalue3)){ showAlert("MSGC00140", fieldName3, nFieldName); return false; } if ((fieldvalue1 != "") || (fieldvalue2 != "") || (fieldvalue3 != "")){ var chk_cd3 = fieldvalue1.length + fieldvalue2.length + fieldvalue3.length //2003.12.25 henko start // if (chk_cd3 != 10 || fieldvalue3.length!=4 ){ ; if (!(chk_cd3 == 10 || chk_cd3 == 9) || fieldvalue3.length!=4 ){ ; //2003.12.25 henko end showAlert("MSGC00260", fieldName1, nFieldName); return false; } } return true; } /** * 有効な携帯電話番号かどうかをチェックします。 * 有効な携帯電話番号であればtrueを返します。 */ function KTel_chk(fieldName1, fieldName2, fieldName3, nFieldName,isRequired){ fieldvalue1 = eval("document.form1." + fieldName1 + ".value"); fieldvalue2 = eval("document.form1." + fieldName2 + ".value"); fieldvalue3 = eval("document.form1." + fieldName3 + ".value"); str = fieldvalue1 + fieldvalue2 + fieldvalue3; if (isRequired){ if (fieldvalue1 == ""){ showAlert("MSGC00130", fieldName1, nFieldName, "市外局番"); return false; } } if (!Hankaku_Suji_chk(fieldName1, nFieldName)){; return false; } if (fieldvalue1 != ""){ var chk_cd1 = fieldvalue1.substring(0,1); if (chk_cd1 !="0"){ ; showAlert("MSGC00240", fieldName1, nFieldName); return false; } if(!zero_chk(fieldvalue1)){ showAlert("MSGC00140", fieldName1, nFieldName); return false; } var chk_cd2 = fieldvalue1.substring(2,3); if (chk_cd2 != "0"){ ; showAlert("MSGC00220", fieldName1, nFieldName); return false; } } if (isRequired){ if (fieldvalue2 == ""){ showAlert("MSGC00130", fieldName2, nFieldName, "市内局番"); return false; } } if (!Hankaku_Suji_chk(fieldName2, nFieldName)){; return false; } if(!zero_chk(fieldvalue2)){ showAlert("MSGC00140", fieldName2, nFieldName); return false; } if (isRequired){ if (fieldvalue3 == ""){ showAlert("MSGC00130", fieldName3, nFieldName, "加入者番号"); return false; } } if (!Hankaku_Suji_chk(fieldName3, nFieldName)){; return false; } if(!zero_chk(fieldvalue3)){ showAlert("MSGC00140", fieldName3, nFieldName); return false; } if ((fieldvalue1 != "") || (fieldvalue2 != "") || (fieldvalue3 != "")){ var chk_cd3 = fieldvalue1.length + fieldvalue2.length + fieldvalue3.length if (chk_cd3 != 11 || fieldvalue3.length !=4 ){ showAlert("MSGC00260", fieldName1, nFieldName); return false; } } return true; } /** * 半角入力不可文字かどうかをチェックします。 * 半角入力不可文字でなければtrueを返します。 */ function Hankaku_DisableChars_chk(fieldName1, nFieldName){ str = eval("document.form1." + fieldName1 + ".value"); if (!inner_Hankaku_DisableChars_chk(str)) { showAlert("MSGC00320", fieldName1, nFieldName); return false; } return true; } /** * 有効な電話番号かどうかをチェックします。(携帯電話番号可) * 有効な電話番号であればtrueを返します。 */ function Tel_chk2(fieldName1, fieldName2, fieldName3, nFieldName,isRequired){ fieldvalue1 = eval("document.form1." + fieldName1 + ".value"); fieldvalue2 = eval("document.form1." + fieldName2 + ".value"); fieldvalue3 = eval("document.form1." + fieldName3 + ".value"); str = fieldvalue1 + fieldvalue2 + fieldvalue3; if (isRequired){ if (fieldvalue1 == ""){ showAlert("MSGC00130", fieldName1, nFieldName, "市外局番"); return false; } } if (!Hankaku_Suji_chk(fieldName1, nFieldName)){; return false; } if (fieldvalue1 != ""){ var chk_cd1 = fieldvalue1.substring(0,1); if (chk_cd1 !="0"){ ; showAlert("MSGC00240", fieldName1, nFieldName); return false; } } if(!zero_chk(fieldvalue1)){ showAlert("MSGC00140", fieldName1, nFieldName); return false; } if (isRequired){ if (fieldvalue2 == ""){ showAlert("MSGC00130", fieldName2, nFieldName, "市内局番"); return false; } } if (!Hankaku_Suji_chk(fieldName2, nFieldName)){; return false; } if(!zero_chk(fieldvalue2)){ showAlert("MSGC00140", fieldName2, nFieldName); return false; } if (isRequired){ if (fieldvalue3 == ""){ showAlert("MSGC00130", fieldName3, nFieldName, "加入者番号"); return false; } } if (!Hankaku_Suji_chk(fieldName3, nFieldName)){; return false; } if(!zero_chk(fieldvalue3)){ showAlert("MSGC00140", fieldName3, nFieldName); return false; } if ((fieldvalue1 != "") || (fieldvalue2 != "") || (fieldvalue3 != "")){ var chk_cd3 = fieldvalue1.length + fieldvalue2.length + fieldvalue3.length //2003.12.25 henko start // if (!(chk_cd3 == 10 || chk_cd3 == 11) || fieldvalue3.length!=4 ){ ; if (!(chk_cd3 == 10 || chk_cd3 == 11 || chk_cd3 == 9) || fieldvalue3.length!=4 ){ ; //2003.12.25 henko end showAlert("MSGC00260", fieldName1, nFieldName); return false; } } return true; } /** * 2値がイコールかどうかをチェックします。 * イコールであればtrueを返します。 */ function Equal_chk(fieldName1, fieldName2, nFieldName){ fieldvalue1 = eval("document.form1." + fieldName1 + ".value"); fieldvalue2 = eval("document.form1." + fieldName2 + ".value"); if ((fieldvalue1 != "") || (fieldvalue2 != "")){ if (fieldvalue1 != fieldvalue2){ showAlert("MSGC00300", fieldName1, nFieldName); return false; } } return true; } /** * 有効なメールアドレスかどうかをチェックします。 * 有効なメールアドレスであればtrueを返します。 * 実際に存在するドメインorユーザであるかはチェックしません。 * fileNameが一つで携帯チェックなし */ function Mail_chk3(fieldName1, nFieldName){ strToken = eval("document.form1." + fieldName1 + ".value"); fieldvalue1 = ""; fieldvalue2 = ""; index = strToken.indexOf("@"); fieldvalue1 = strToken.substring(0, index); if ((index + 1) < strToken.length) { fieldvalue2 = strToken.substring(index + 1, strToken.length); } str = fieldvalue1 + fieldvalue2; if (fieldvalue1 == ""){ showAlert("MSGC00140", fieldName1, nFieldName); return false; } if (!inner_Hankaku_chk(fieldvalue1)){ showAlert("MSGC00150", fieldName1, nFieldName); return false; } if (!inner_Hankaku_Kana_chk(fieldvalue1)){ showAlert("MSGC00150", fieldName1, nFieldName); return false; } if (!inner_Hankaku_DisableChars_chk(fieldvalue1)){ showAlert("MSGC00320", fieldName1, nFieldName); return false; } if (fieldvalue1.length != 0){ f_quest = fieldvalue1.indexOf("@") if ( f_quest != -1) { showAlert("MSGC00170", fieldName1, nFieldName); return false; } } if (fieldvalue1.length != 0){ f_quest = fieldvalue1.indexOf(",") if ( f_quest != -1) { showAlert("MSGC00180", fieldName1, nFieldName); return false; } } if (fieldvalue1.length != 0){ f_quest = fieldvalue1.indexOf(" ") if ( f_quest != -1) { showAlert("MSGC00190", fieldName1, nFieldName); return false; } } if (fieldvalue2 == ""){ showAlert("MSGC00140", fieldName1, nFieldName); return false; } if (!inner_Hankaku_chk(fieldvalue2)){ showAlert("MSGC00150", fieldName1, nFieldName); return false; } if (!inner_Hankaku_Kana_chk(fieldvalue2)){ showAlert("MSGC00150", fieldName1, nFieldName); return false; } if (!inner_Hankaku_DisableChars_chk(fieldvalue2)){ showAlert("MSGC00320", fieldName1, nFieldName); return false; } if (fieldvalue2.length != 0){ f_quest = fieldvalue2.indexOf(".") f_length = fieldvalue2.length-1 if ( f_quest == 0 || f_quest == -1 || f_quest == f_length ){ showAlert("MSGC00200", fieldName1, nFieldName); return false; } } if (fieldvalue2.length != 0){ f_quest = fieldvalue2.indexOf("@") if ( f_quest != -1) { showAlert("MSGC00170", fieldName1, nFieldName); return false; } } if (fieldvalue2.length != 0){ f_quest = fieldvalue2.indexOf(",") if ( f_quest != -1) { showAlert("MSGC00180", fieldName1, nFieldName); return false; } } if (fieldvalue2.length != 0){ var_lastchar = fieldvalue2.charAt(f_length) if ( var_lastchar == "." ) { showAlert("MSGC00210", fieldName1, nFieldName); return false; } } if (fieldvalue2.length != 0){ f_quest = fieldvalue2.indexOf(" ") if ( f_quest != -1) { showAlert("MSGC00190", fieldName1, nFieldName); return false; } } // .. は不可 for(var i = 0; i < fieldvalue2.length - 1; i++){ if(".." == fieldvalue2.substr(i,2)){ showAlert("MSGC00370", fieldName1, nFieldName); return false; } } return true; } /** * === 内部function === * オールゼロかどうかをチェックします。 * オールゼロであればfalseを返します。 */ function zero_chk(str){ var chk_str = parseInt(str,10); if (chk_str==0){ return false; }else{ return true; } } /** * === 内部function === * 半角かどうかをチェックします。 * OKであればtrueを返します。 */ function inner_Hankaku_chk(str){ chk_flg = true; for (i=0;i<=str.length-1;i++){ b = str.substring(i,i+1) xb = escape(b) if(xb.length==3){ xb2 = xb.substring(1,3) if((("80"<=xb2)&(xb2<"A1"))|("DF" < xb2)){ //アスキーコードによる判定(nn4.05以下) chk_flg=false break } }else{ if(xb.length==6){ f_code = xb.substring(0,2) if (f_code == "%u") { //ユニコードによる判定(ie4.x) xb2=xb.substring(2,6) if((xb2<"FF61")|("FF9F" < xb2)){ chk_flg=false break } }else{ //アスキーコードによる判定(nn4.05以上) xb2 = xb.substring(1,3) if((("80"<=xb2)&(xb2<"A1"))|("DF" < xb2)){ chk_flg=false break } } }else{ if(xb.length == 4){ xb2=xb.substring(1,3) if((("80"<=xb2)&(xb2<"A1"))|("DF" < xb2)){ //アスキーコードによる判定(nn4.05以上)全角数字等の対応 chk_flg=false break } }else{ if(xb.length!=1){ alert("チェックロジックエラー") alert(xb) chk_flg = false break } } } } } return chk_flg; } /** * === 内部function === * 全角文字のチェックを行います。 * 入力不可文字が含まれるとfalseを返します。 */ function inner_DisableChars_chk(str){ for (i=0; i -1) return false; } return true; } /** * === 内部function === * 半角英数字かどうかをチェックします。 * OKであればtrueを返します。 */ function inner_Hankaku_EijiSuji_chk(str){ var chk_flg = true; var checkOK = HANKAKU_EIJI_VAL + HANKAKU_SUJI_VAL; // OKな文字種 var checkStr = str; // チェックする文字列 var allValid = true; // 全ての文字がOKかどうかのフラグ for (i = 0; i < checkStr.length; i++){ ch = checkStr.charAt(i); // チェックする文字列から1文字づつ取得 for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length){ // チェックOK文字種の中に存在しない場合 allValid = false; // NG文字があったのでフラグをfalseとする break; } } if (!allValid) { chk_flg= false; } return chk_flg } /** * === 内部function === * 半角数字かどうかをチェックします。 * OKであればtrueを返します。 */ function inner_Hankaku_Suji_chk(str){ var chk_flg = true; var checkOK = HANKAKU_SUJI_VAL; // OKな文字種 var checkStr = str; // チェックする文字列 var allValid = true; // 全ての文字がOKかどうかのフラグ for (i = 0; i < checkStr.length; i++){ ch = checkStr.charAt(i); // チェックする文字列から1文字づつ取得 for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length){ // チェックOK文字種の中に存在しない場合 allValid = false; // NG文字があったのでフラグをfalseとする break; } } if (!allValid) { chk_flg= false; } return chk_flg } /** * === 内部function === * 全角文字かどうかをチェックします。 * OKであればtrueを返します。 */ function inner_Zenkaku_chk(str){ chk_flg = true for (i=0;i<=str.length-1;i++){ b = str.substring(i,i+1) xb = escape(b) if(xb.length==3){ if ( (navigator.appName.charAt(0)=="N") && (navigator.appVersion.substring(0,4)>="4.06") ) { //nn4.06以上、ie4.x以上の対応 xb2 = xb.substring(1,3) if((("80"<=xb2)&(xb2<"A1"))|("DF" < xb2)){ chk_flg = true }else{ chk_flg=false break } } else { // nn4.06以下の対応 xb2 = xb.substring(1,3) if((("80"<=xb2)&(xb2<"A1"))|("DF" < xb2)){ i++ }else{ chk_flg=false break } } }else{ if(xb.length==6){ f_code = xb.substring(0,2) if (f_code == "%u") { //ユニコードによる判定(ie4.x) xb2=xb.substring(2,6) if((xb2<"FF61")|("FF9F" < xb2)){ chk_flg = true }else{ chk_flg=false break } }else{ //アスキーコードによる判定(nn4.05以上) xb2 = xb.substring(1,3) if((("80"<=xb2)&(xb2<"A1"))|("DF" < xb2)){ chk_flg = true }else{ chk_flg=false break } } }else{ if(xb.length == 4){ xb2=xb.substring(1,3) if((("80"<=xb2)&(xb2<"A1"))|("DF" < xb2)){ //アスキーコードによる判定(nn4.05以上)全角数字等の対応 chk_flg = true }else{ chk_flg=false break } }else{ if(xb.length!=1){ alert("チェックロジックエラー") alert(xb) chk_flg=false break } chk_flg=false break } } } } return chk_flg; } /** * === 内部function === * 全角カタカナかどうかをチェックします。 * OKであればtrueを返します。 */ function inner_Zenkaku_Kana_chk(str){ var chk_flg = true; var checkOK = ZENKAKU_KANA_VAL; var checkStr = str; var allValid = true; var allNum = ""; for (i = 0; i < checkStr.length; i++){ ch = checkStr.charAt(i); // チェックする文字列から1文字づつ取得 for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length){ // チェックOK文字種の中に存在しない場合 allValid = false; // NG文字があったのでフラグをfalseとする break; } } if (!allValid) { chk_flg= false; } return chk_flg } /** * === 内部function === * 全角数字かどうかをチェックします。 * OKであればtrueを返します。 */ function inner_Zenkaku_Suji_chk(str){ var chk_flg = true; var checkOK = ZENKAKU_SUJI_VAL; var checkStr = str; var allValid = true; var allNum = ""; for (i = 0; i < checkStr.length; i++){ ch = checkStr.charAt(i); // チェックする文字列から1文字づつ取得 for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length){ // チェックOK文字種の中に存在しない場合 allValid = false; // NG文字があったのでフラグをfalseとする break; } } if (!allValid) { chk_flg= false; } return chk_flg } /** * === 内部function === * 全角英字かどうかをチェックします。 * OKであればtrueを返します。 */ function inner_Zenkaku_Eiji_chk(str){ var chk_flg = true; var checkOK = ZENKAKU_EIJI_VAL; var checkStr = str; var allValid = true; var allNum = ""; for (i = 0; i < checkStr.length; i++){ ch = checkStr.charAt(i); // チェックする文字列から1文字づつ取得 for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length){ // チェックOK文字種の中に存在しない場合 allValid = false; // NG文字があったのでフラグをfalseとする break; } } if (!allValid) { chk_flg= false; } return chk_flg } /** * === 内部function === * カタカナor英字or数字or記号かどうかをチェックします。(英字数字は半角全角可能) * OKであればtrueを返します。 */ function inner_KanaEijiSujiMark_chk(str){ var chk_flg = true; var checkOK = HANKAKU_SUJI_VAL + HANKAKU_EIJI_VAL + ZENKAKU_KANA_VAL + ZENKAKU_SUJI_VAL + ZENKAKU_EIJI_VAL + MARK1_VAL + MARK2_VAL; var checkStr = str; var allValid = true; var allNum = ""; for (i = 0; i < checkStr.length; i++){ ch = checkStr.charAt(i); // チェックする文字列から1文字づつ取得 for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length){ // チェックOK文字種の中に存在しない場合 allValid = false; // NG文字があったのでフラグをfalseとする break; } } if (!allValid) { chk_flg= false; } return chk_flg } /** * === 内部function === * 日付の正当性をチェックします。(閏年も考慮) * OKであればtrueを返します。 */ function inner_Date_chk(str){ var chk_flg = true var strLen = str.length if (!inner_Hankaku_Suji_chk(str)) return false; if (strLen == 8){ var strYear = str.substring(0, 4); var strMonth = str.substring(4, 6); var strDay = str.substring(6, 8); strYear = eval(strYear) strMonth = eval(strMonth) strDay = eval(strDay) var dd = new Date(); var yy = dd.getYear(); if (yy < 1900) yy += 1900; if (strMonth < 1 || strMonth > 12) { chk_flg = false; } else if (strDay < 1 || strDay > 31) { chk_flg = false; } else if ((strMonth == 4 || strMonth == 6 || strMonth == 9 || strMonth == 11) && strDay == 31) { chk_flg = false; } else if (strMonth == 2 && strDay > 29) { chk_flg = false; } else if (strMonth == 2 && strDay == 29) { var intAns = strYear % 4 if (intAns == 0) { intAns = strYear % 100 if (intAns == 0) { intAns = strYear % 400 if (intAns != 0) { chk_flg = false; } } } else { chk_flg = false; } } } else { chk_flg = false; } return chk_flg } /** * === 内部function === * ラジオボタンの選択有無をチェックします。 * 選択されていればtrueを返します。 */ function inner_Radio_chk(fieldName){ var chk_flg = true var num = "document.form1." + fieldName + ".length" ; num = eval(num) for (i=0;i<=num-1;i++){ var flg = "ng"; var chk = "document.form1." + fieldName +"[i].checked"; chk = eval(chk); if (chk == true) { flg = "ok" ; break; } } if (flg == "ng") { chk_flg = false; } return chk_flg } /** * === 内部function === * 半角カタカナかどうかをチェックします。 * 半角カタカナであればfalseを返します。 */ function inner_Hankaku_Kana_chk(str){ var chk_flg = true var checkNG=HANKAKU_KANA_VAL; var checkStr = str var allValid = true; var allNum = ""; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkNG.length; j++) { if (ch == checkNG.charAt(j)) { chk_flg= false; break; } } } return chk_flg } /** * === 内部function === * 半角入力不可文字かどうかをチェックします。 * 半角入力不可文字であればfalseを返します。 */ function inner_Hankaku_DisableChars_chk(str){ var chk_flg = true; var checkNG=HANKAKU_KANA_VAL + MARK3_VAL; var checkStr = str; var allValid = true; var allNum = ""; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkNG.length; j++) { if (ch == checkNG.charAt(j)) { chk_flg= false; break; } } } return chk_flg } /** * 有効なパスワードかどうかをチェックします。 * 有効なパスワードであればtrueを返します。 */ //2003.12.24 add start function Password_chk(fieldName1, nFieldName){ str = eval("document.form1." + fieldName1 + ".value"); if (!inner_Hankaku_EijiSuji_chk(str)) { showAlert("MSGC00050", fieldName1, nFieldName); return false; } if (str.length != 0){ if (str.length < 4 || str.length > 8){ showAlert("MSGC00270", fieldName1, nFieldName); return false; } } return true; } //2003.12.24 add end //ほっとホット通信希望で星座を選択していない場合のエラー処理 2004.10.06 function checkPatternMatching(){ seizaValue = document.form1.seiza.value; hothot_c0 = document.form1.hothot[0].checked; if( hothot_c0){ if( seizaValue == "11" ){ alert( "ほっとホット通信をご希望の方は、星座を選択してください。" ); document.form1.seiza.focus(); return false; } } return true; } /* 指定のメッセージコードで警告ダイアログを表示 */ function alertMessage(errorCode,arg1,arg2){ alert(getMessage(errorCode,arg1,arg2)); } /* 指定のメッセージコードで警告ダイアログを表示 */ function confirmMessage(errorCode,arg1,arg2){ return confirm(getMessage(errorCode,arg1,arg2)); } /* 指定のメッセージコードよりメッセージを返す */ function getMessage(errorCode,arg1,arg2){ return msgMgr(errorCode).replace("&1",arg1).replace("&2",arg2); } function msgMgr(errorCode){ switch (errorCode){ case "MSGC00010" : return "&1が入力されていません。"; case "MSGC00020" : return "先頭に空白文字は利用できません。"; case "MSGC00030" : return "&1は&2文字以内で入力して下さい。"; case "MSGC00040" : return "&1は半角英字(a-z,A-Z)のみ有効です。"; case "MSGC00050" : return "&1は半角英数字(a-z,A-Z,0-9)のみ有効です。"; case "MSGC00060" : return "&1は半角数字(0-9)のみ有効です。"; case "MSGC00070" : return "&1は全角で入力して下さい。\nスペースも全角のみ可能です。"; case "MSGC00080" : return "&1は全角カタカナで入力して下さい。\nスペースも全角のみ可能です。"; case "MSGC00100" : return "&1は全角カタカナ または 全角英数字で入力して下さい。\n括弧や長音記号も使用出来ます。"; case "MSGC00110" : return "&1は日付として正しくありません。"; case "MSGC00120" : return "&1が選択されていません。"; case "MSGC00130" : return "&1の&2が入力されていません。"; case "MSGC00140" : return "&1が正しく入力されていません。"; case "MSGC00150" : return "&1は半角で入力して下さい(半角カタカナは不可)。"; case "MSGC00160" : return "&1の桁数が正しくありません。"; case "MSGC00170" : return "&1が正しく入力されていません。\nアットマーク(@)の個数が不正です。"; case "MSGC00180" : return "&1が正しく入力されていません。\nカンマ(,)はメールアドレスには使用できません。"; case "MSGC00190" : return "&1が正しく入力されていません。\nスペースは入力しないでください。"; case "MSGC00200" : return "&1が正しく入力されていません。\nドット(.)の位置を確認して下さい。"; case "MSGC00210" : return "&1が正しく入力されていません。\nドット(.)が最後に付いています。確認して下さい。"; case "MSGC00220" : return "&1は、携帯電話・PHSの番号を入力してください。"; case "MSGC00230" : return "&1が正しく入力されていません。\n上3桁が全てゼロになっています。"; case "MSGC00240" : return "電話番号(市外局番)に誤りがあります。確認してください。"; case "MSGC00250" : return "&1は、携帯電話・PHS以外の番号を入力してください。"; case "MSGC00260" : return "&1の桁数に誤りがあります。"; case "MSGC00270" : return "&1は4桁から8桁を入力してください。"; case "MSGC00300" : return "&1と確認用の入力内容が一致していません。確認してください。"; case "MSGC00310" : return "&1にはJIS範囲外の特殊文字や外字は入力できません。"; case "MSGC00320" : return "&1が正しく入力されていません。\n半角カタカナや記号(<>'\"?&)は入力しないでください。"; case "MSGC00370" : return "&1が正しく入力されていません。\nドット(ピリオド)が2つ続いています。"; case "MSGC00380" : return "■jp-*.ne.jpをご利用の方へ\njp-*.ne.jpは、*.vodafone.ne.jpに変更されました。確認の上、再入力をお願いします。"; case "MSGC00390" : return "&1は、携帯電話・PHS以外のメールアドレスを入力してください。"; } return "メッセージ未登録:" + errorCode; } // 2007.02.28 FDX)菅原 共通部品として追加 function trimSp(name){ // フォーム名を受け取って全半角空白を取り除く var str = "document.form1." + name + ".value"; str = eval(str); if(null == str || "" == str){ return; } var retStr = ""; var prtStr = ""; var i= 0; for(i = 0; i < str.length; i++){ // 1文字ずつ抜き出して比較 prtStr = str.substring(i, i+1); if(prtStr == " " || prtStr == " "){ } else{ retStr += prtStr; } } for(i = 0; i