MIL041.inc
2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
var SFlg = false; //サブミットフラグを定義
function DoubleSubmit(){ //ダブルサブミットチェック関数
if (SFlg){ //ダブルサブミットの場合
alert("応答中です"); //メッセージを出力
return false;
}
SFlg = true; //サブミットフラグを設定
return true; //戻り値を設定
}
function chk(kind_flg){
if (hissu_chk("氏名(表示名)",document.e_gru.view_name.value)==false) {
document.e_gru.view_name.focus();
return false;
}
if (script_chk("氏名(表示名)",document.e_gru.view_name.value)==false) {
document.e_gru.view_name.focus();
return false;
}
if (hissu_chk("氏名(フリガナ)",document.e_gru.name_furi.value)==false) {
document.e_gru.name_furi.focus();
return false;
}
if (script_chk("氏名(フリガナ)",document.e_gru.name_furi.value)==false) {
document.e_gru.name_furi.focus();
return false;
}
if (kana_chk("氏名(フリガナ)",document.e_gru.name_furi.value)==false) {
document.e_gru.name_furi.focus();
return false;
}
if (hissu_chk("メールアドレス",document.e_gru.e_mail.value)==false) {
document.e_gru.e_mail.focus();
return false;
}
if (script_chk("メールアドレス",document.e_gru.e_mail.value)==false) {
document.e_gru.e_mail.focus();
return false;
}
if (checkEmail(document.e_gru.e_mail.value)==false) {
document.e_gru.e_mail.focus();
return false;
}
function checkEmail(checkString){
var newstr = "";
var at = false;
var dot = false;
if (checkString.indexOf("@") != -1) {
at = true;
} else if (checkString.indexOf(".") != -1) {
dot = true;
}
for (var i = 0; i < checkString.length; i++) {
ch = checkString.substring(i, i + 1)
if ((ch >= "A" && ch <= "Z") || (ch >= "a" && ch <= "z")
|| (ch == "@") || (ch == ".") || (ch == "_")
|| (ch == "-") || (ch >= "0" && ch <= "9")) {
newstr += ch;
if (ch == "@") {
at=true;
}
if (ch == ".") {
dot=true;
}
}
}
if ((at == true) && (dot == true)) {
return newstr;
} else {
alert ("入力されたメールアドレスは\n不正なアドレスのようです。\n再度入力し直してください。");
return false;
}
}
if (DoubleSubmit()) {
document.e_gru.kind_flg.value =kind_flg;
document.e_gru.action = "MIL042.php";
document.e_gru.method="POST";
document.e_gru.submit();
return true;
}
}
-->
</SCRIPT>