PageSourceSearch

https://www.13do.com/res/layout004/js/form-check.js?1407393716

js 13do.com collected 2026-10-04 09:54:28 UTC 5,780 bytes, 183 lines download raw bytes

1;
2var formOnloadStatus = false;
3
4// start : for pc html5 site -----------------------------------------------------
5var NG_icon2 = NG_icon;
6var loadingDisplay1 = loadingDisplay;
7var loadingDisplay2 = loadingDisplay;
8
9// 入力チェックエラーclass付与入力OKのclass削除
10function addErrorClassName(msgElem) {
11    var name = msgElem.replace(/_status/, '');
12    var $blockElem = jQuery('#' + name + '_block');
13    if (0 < $blockElem.length) {
14        if (!$blockElem.hasClass('error_row')) {
15            $blockElem.addClass('error_row');
16        }
17        if ($blockElem.hasClass('ok_row')) {
18            $blockElem.removeClass('ok_row');
19        }
20    }
21}
22
23// 入力チェックエラーclass削除&入力OKのclass付与
24function cutErrorClassName(msgElem) {
25    var name = msgElem.replace(/_status/, '');
26    var $blockElem = jQuery('#' + name + '_block');
27    if (0 < $blockElem.length) {
28        if ($blockElem.hasClass('error_row')) {
29            $blockElem.removeClass('error_row');
30        }
31        if (!$blockElem.hasClass('ok_row')) {
32            $blockElem.addClass('ok_row');
33        }
34    }
35}
36
37// 空白OKで空の状態
38function cutRowStatus(msgElem) {
39    var name = msgElem.replace(/_status/, '');
40    var $blockElem = jQuery('#' + name + '_block');
41    $blockElem.removeClass('ok_row error_row');
42}
43
44// フォーム要素に入力値OKのclass名付与 (入力確認有りの1つ目用)
45function addOKInputClassName (msgElem) {
46    var name = msgElem.replace(/_status/, '');
47    jQuery('#' + name).addClass('ok_input');
48}
49
50// フォーム要素から入力値OKのclass名を削除 (入力確認有りの1つ目用)
51function cutOKInputClassName (msgElem) {
52    var name = msgElem.replace(/_status/, '');
53    jQuery('#' + name).removeClass('ok_input');
54}
55
56// エラー表示OFF
57function hideErrorDisplay(msgElem, strict) {
58    if (!formOnloadStatus) {
59        return;
60    }
61    var name = msgElem.replace(/_status/, '');
62    var errorBox = jQuery('.error_box');
63    var blockElem = jQuery('#' + name + '_block');
64    var cellBoxElem = blockElem.find('.cell_box');
65    if (blockElem) {
66        var borderElem = jQuery('#' + name + '_border')[0];
67        var noticeElem = jQuery('#' + name + '_notice')[0];
68        if (!strict) {
69            if (blockElem.hasClass('form_alpha')) {
70                blockElem.removeClass('form_alpha');
71            }
72        }
73        if (blockElem.hasClass(ERROR_CLASS)) {
74            blockElem.removeClass(ERROR_CLASS);
75            if (borderElem) {
76                borderElem.style.display = 'none';
77            }
78            if (noticeElem) {
79                noticeElem.style.display = 'none';
80            }
81        }
82        if (blockElem.hasClass(ERROR_CLASS + '_block')) {
83            blockElem.removeClass(ERROR_CLASS + '_block');
84        }
85        if (cellBoxElem[0]) {
86            if (cellBoxElem.hasClass('cell_form_error')) {
87                cellBoxElem.removeClass('cell_form_error');
88            }
89        }
90    }
91    if (errorBox[0] && errorBox[0].style.display !== 'none' && jQuery('.' + ERROR_CLASS).length === 0) {
92        errorBox.css('display', 'none');
93    }
94}
95
96// 透過表示OFF
97function hideDiaphanousDisplay(msgElem) {
98    if (!formOnloadStatus || !globalObj.formErrorStatus) {
99        return;
100    }
101    var name = msgElem.replace(/_status/, '');
102    var blockElem = jQuery('#' + name + '_block');
103    if (blockElem && blockElem.hasClass('form_alpha')) {
104        blockElem.removeClass('form_alpha');
105    }
106}
107
108// 区切り線の表示切り替え
109function toggleFormLine(msgElem, value) {
110    var name = msgElem.replace(/_status/, '');
111    var borderElem = jQuery('#' + name + '_border')[0];
112    if (borderElem) {
113        borderElem.style.display = value;
114    }
115}
116
117function loginCheck(emailElem, passwordElem) {
118    if (jQuery('#' + emailElem).val() && jQuery('#' + passwordElem).val()) {
119        hideErrorDisplay(emailElem);
120        hideErrorDisplay(passwordElem);
121        cutErrorClassName(passwordElem);
122    }
123}
124
125function disableEnterSubmit(elem) {
126    elem.keypress(function (e) {
127        if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
128            return false;
129        }
130    });
131}
132
133function setBeforeunloadEvent(pageState, submitFlag, obj, formObj) {
134    if (pageState == 'edit') {
135        if (submitFlag && !checkAllEnpty(obj)) {
136            window.onbeforeunload = function () {return MSG_UNLOAD;};
137        }
138        obj.change(function (e) {
139            if (jQuery(e.target).val() == '' && checkAllEnpty(obj)) {
140                if (window.onbeforeunload != null) {
141                    window.onbeforeunload = null;
142                }
143            } else {
144                if (window.onbeforeunload == null) {
145                    window.onbeforeunload = function () {return MSG_UNLOAD;};
146                }
147            }
148        });
149    } else {
150        window.onbeforeunload = function () {return MSG_UNLOAD;};
151    }
152    formObj.submit(function () {window.onbeforeunload = null;});
153}
154
155function checkAllEnpty(obj) {
156    var empty = true;
157    obj.each(function (index, elem) {
158        if (jQuery(elem)[0] && jQuery(elem).val()) {
159            empty = false;
160            return false;
161        }
162    });
163    return empty;
164}
165
166// !(必須)をセット
167function setRequired(msgElem, required) {
168    var $msgElem = jQuery('#' + msgElem),
169        requiredTrClassName = 'required_row',
170        $trElem;
171    if ($msgElem) {
172        $trElem = $msgElem.closest('tr');
173        if (required) {
174            $msgElem.html(LBL_REQUIRED);
175            $trElem.addClass(requiredTrClassName);
176        } else {
177            $msgElem.html('');
178            $trElem.removeClass(requiredTrClassName)
179        }
180    }
181}
182// end : for pc html5 site -----------------------------------------------------
183

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.