PageSourceSearch

https://www.photoland21.jp/contact/common.js

js photoland21.jp collected 2026-10-05 11:15:53 UTC 3,780 bytes, 111 lines download raw bytes

1// JavaScript Document
2
3/////////////////////////////////////
4// 汎用確認メッセージ
5/////////////////////////////////////
6function ConfirmMsg(msg) {
7    return (confirm(msg)) ? true : false;
8}
9
10/////////////////////////////////////////////////////////////////////////////////
11// 未入力及び不正入力のチェック(※Safariのバグ(エスケープ文字認識)を回避)
12/////////////////////////////////////////////////////////////////////////////////
13function inputChk(f, confirm_flg) {
14
15    // フラグの初期化
16    var flg = false;
17    var error_mes = "Error Message\r\n恐れ入りますが、下記の内容を確認してください。\r\n\r\n";
18
19    // 未入力と不正入力のチェック
20    if (f.action.value == "confirm") { //入力画面用だけに処理をする
21
22        var flag = 1;  var other_flag = 0; 
23        for (var i = 0; i < f.elements.length; i++) { //全項目数を数える
24            if ((f.elements[i].name == 'inquiry_item[]') && (f.elements[i].checked)) { //条件に一致するnameを探す
25                flag = 0;
26            }
27            if ((f.elements[i].name == 'inquiry_item[]') && (f.elements[i].checked) && (f.elements[i].value == 'その他')) {
28                other_flag = 1;
29            }
30        }
31
32        if (flag == 1) {
33            error_mes += "・お問い合わせ項目を選択してください。\r\n";
34            flg = true;
35        }
36        
37        if(other_flag == 1 && !f.inquiry_item_text.value) {
38            error_mes += "・お問い合わせ項目(その他)を入力してください。\r\n";
39            flg = true;
40        }
41        
42    }
43
44    if (!f.name.value) {
45        error_mes += "・氏名を入力してください。\r\n";
46        flg = true;
47    }
48
49    if (!f.kana.value) {
50        error_mes += "・フリガナを入力してください。\r\n";
51        flg = true;
52    }
53
54    if (!f.tel.value) {
55        error_mes += "・電話番号を入力してください。\r\n";
56        flg = true;
57    }
58
59    // メールアドレス欄が1つならfalse。2つならtrue。
60    var email_flg = false;
61    if (!f.email.value) {
62        error_mes += "・メールアドレスを入力してください。\r\n";
63        flg = true;
64    } else if (!f.email.value.match(/^[^@]+@[^.]+\..+/)) {
65        error_mes += "・メールアドレスの形式に誤りがあります。\r\n";
66        flg = true;
67    } else {
68        email_flg = true;
69    }
70
71    if (email_flg) {
72        var c_email_flg = false;
73        if (!f.c_email.value) {
74            error_mes += "・メールアドレス(確認用)を入力してください。\r\n";
75            flg = true;
76        } else if (!f.c_email.value.match(/^[^@]+@[^.]+\..+/)) {
77            error_mes += "・メールアドレス(確認用)の形式に誤りがあります。\r\n";
78            flg = true;
79        } else {
80            c_email_flg = true;
81        }
82
83        if (email_flg && c_email_flg) {
84            if (f.email.value != f.c_email.value) {
85                error_mes += "・メールアドレスとメールアドレス(確認用)が一致しません。\r\n";
86                flg = true;
87            }
88        }
89    }
90
91    if (!confirm_flg) {
92        if (!f.agreement.checked) {
93            error_mes += "・「個人情報保護方針」の内容に同意されておりません。\r\n"; flg = true;
94        }
95    }
96
97    // 判定
98    if (flg) {
99        // アラート表示して再入力を警告
100        window.alert(error_mes);
101        return false;
102    } else {
103
104        // 確認メッセージ
105        if (confirm_flg) {
106            return ConfirmMsg('入力いただいた内容で送信します。\nよろしいですか?');
107        }
108        return true;
109    }
110
111}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.