PageSourceSearch

https://a-l-c.jp/js/share/entry.js

js a-l-c.jp collected 2026-10-05 20:04:57 UTC 31,536 bytes, 996 lines download raw bytes

1var dt = new Date();
2var birthYearMin = dt.getFullYear() - 65;
3var birthYearMax = dt.getFullYear() - 18;
4
5// リロード時
6$(function () {
7    checkStep1();
8    checkStep2();
9});
10
11/*
12 * STEP1 必須項目
13 */
14// テキストの場合
15function inputOptionsText(num) {
16    var ret = checkOptionsText(num);
17    if (ret) {
18        $('#errorOption_' + num).addClass('js-hide');
19        checkStep1();
20    } else {
21        $('#errorOption_' + num).removeClass('js-hide');
22        step1disabled();
23    }
24    return;
25}
26function checkOptionsText(num) {
27    var inputVal = document.getElementById('option_item_text_' + num).value;
28    var errorOption = document.getElementById('errorOption_' + num);
29    var required = 'required_' + num;
30    if (document.getElementById(required) != null) {
31        if (0 == inputVal.length) {
32            errorOption.innerHTML = "<p>こちらは必須です</p>";
33            return false;
34        }
35    }
36    if (inputVal.length > 100) {
37        errorOption.innerHTML = "<p>こちらは100文字まで入力可能です</p>";
38        return false;
39    }
40    return true;
41}
42// テキストエリアの場合
43function inputOptionsTextarea(num) {
44    var ret = checkOptionsTextarea(num);
45    if (ret) {
46        $('#errorOption_' + num).addClass('js-hide');
47        checkStep1();
48    } else {
49        $('#errorOption_' + num).removeClass('js-hide');
50        step1disabled();
51    }
52    return;
53}
54function checkOptionsTextarea(num) {
55    var inputVal = document.getElementById('option_item_textarea_' + num).value;
56    var errorOption = document.getElementById('errorOption_' + num);
57    var required = 'required_' + num;
58    if (document.getElementById(required) != null) {
59        if (0 == inputVal.length) {
60            errorOption.innerHTML = "<p>こちらは必須です</p>";
61            return false;
62        }
63    }
64    if (inputVal.length > 1000) {
65        errorOption.innerHTML = "<p>こちらは1000文字まで入力可能です</p>";
66        return false;
67    }
68    return true;
69}
70// 選択の場合
71function changeOptions(num) {
72    var ret = checkOptions(num);
73    if (ret) {
74        $('#errorOption_' + num).addClass('js-hide');
75        checkStep1();
76    } else {
77        $('#errorOption_' + num).removeClass('js-hide');
78        step1disabled();
79    }
80    return;
81}
82// 択一選択・複数選択の場合
83function checkOptions(num) {
84    var required = 'required_' + num;
85    var errorOption = document.getElementById('errorOption_' + num);
86    // 必須の場合
87    if (document.getElementById(required) != null) {
88        // 選択されているかどうか取得
89        var elements = document.getElementsByName('option_item_' + num);
90        // チェックボックスの場合
91        if (elements.length == 0) {
92            var elements = document.getElementsByName('option_item_' + num + '[]');
93        }
94        var check = false;
95        for (let i = 0; i < elements.length; i++) {
96            if (elements[i].checked) {
97                check = true;
98            }
99        }
100        if (!check) {
101            errorOption.innerHTML = "<p>こちらは必須です</p>";
102            return false;
103        }
104    }
105    return true;
106}
107
108// 択一選択(プルダウン)の場合
109function inputOptionsPulldown(num) {
110    var ret = checkOptionsPulldown(num);
111    if (ret) {
112        $('#errorOption_' + num).addClass('js-hide');
113        checkStep1();
114    } else {
115        $('#errorOption_' + num).removeClass('js-hide');
116        step1disabled();
117    }
118    return;
119}
120function checkOptionsPulldown(num) {
121    var inputVal = document.getElementById('option_item_pulldown_' + num).value;
122    var errorOption = document.getElementById('errorOption_' + num);
123    var required = 'required_' + num;
124    if (document.getElementById(required) != null) {
125        if (inputVal == "0") {
126            errorOption.innerHTML = "<p>こちらは必須です</p>";
127            return false;
128        }
129    }
130    return true;
131}
132
133// 添付ファイルの場合
134function inputOptionsFile(num) {
135    var ret = checkOptionsFile(num);
136    if (ret) {
137        $('#errorOption_' + num).addClass('js-hide');
138        checkStep1();
139    } else {
140        $('#errorOption_' + num).removeClass('js-hide');
141        step1disabled();
142    }
143    return;
144}
145
146function checkOptionsFile(num) {
147    var inputData = document.getElementById('option_item_file_' + num);
148    var inputFile = document.getElementById('option_item_file_' + num).files[0];
149    var fileExtension = inputFile.name.split('.').pop();
150    var errorOption = document.getElementById('errorOption_' + num);
151    var required = 'required_' + num;
152    var setError = '';
153    const extensionCheck = ['pdf', 'doc', 'docx', 'docm', 'xls', 'xlsx', 'xlsm']
154    // ファイル入力必須チェック
155    if (document.getElementById(required) != null) {
156        if (0 == inputFile.length) {
157            setError += "<p>こちらは必須です</p>";
158        }
159    }
160    // ファイル容量10MB制限
161    if (inputFile.size > 10000000) {
162        setError += "<p>
162アップロードできるファイル容量は10MBまでとなります</p>";
163    }
164    // ファイル形式制限(PDF、ワード、エクセル)
165    if (extensionCheck.indexOf(fileExtension) === -1) {
166        setError += "<p>登録できないファイル形式です。</p><p>※対応しているファイル拡張子: pdf / doc / docx / docm / xls / xlsx / xlsm</p>";
167    }
168    // バリデーションチェック後の処理
169    if (setError) {
170        // エラー時
171        errorOption.innerHTML = setError;
172        inputData.value = '';
173        return false;
174    } else {
175        // 正常時
176        errorOption.innerHTML = '';
177        return true;
178    }
179}
180
181// STEP1 全体チェック
182function checkStep1() {
183    for (var num = 1; num <= 3; num++) {
184        var required = 'required_' + num;
185        // 必須の場合
186        if (document.getElementById(required) != null) {
187            // テキスト
188            if (document.getElementById('option_item_text_' + num) != null) {
189                var ret = checkOptionsText(num);
190                if (!ret) {
191                    step1disabled();
192                    return;
193                }
194            }
195            // テキストエリア
196            if (document.getElementById('option_item_textarea_' + num) != null) {
197                var ret = checkOptionsTextarea(num);
198                if (!ret) {
199                    step1disabled();
200                    return;
201                }
202            }
203            // 択一選択・複数選択
204            if (document.querySelector('.option_ids_' + num)) {
205                var ret = checkOptions(num);
206                if (!ret) {
207                    step1disabled();
208                    return;
209                }
210            }
211            // 択一選択(プルダウン)
212            if (document.getElementById('option_item_pulldown_' + num) != null) {
213                var ret = checkOptionsPulldown(num);
214                if (!ret) {
215                    step1disabled();
216                    return;
217                }
218            }
219            // ファイル
220            if (document.getElementById('option_item_file_' + num) != null) {
221                var ret = checkOptionsFile(num);
222                if (!ret) {
223                    step1disabled();
224                    return;
225                }
226            }
227        }
228    }
229    // エラーなしなので STEP1「次へ進む」ボタン有効化
230    $('#step1Submit').prop('disabled', false);
231    return;
232}
233// STEP1「次へ進む」ボタン無効化
234function step1disabled() {
235    $('#step1Submit').prop('disabled', true);
236    return;
237}
238
239/*
240 * STEP2
241 */
242// お名前(フルネーム)
243function inputFullName() {
244    var ret = checkFullName();
245    if (ret) {
246        $('#errorFullName').addClass('js-hide');
247        checkStep2();
248    } else {
249        $('#errorFullName').removeClass('js-hide');
250        step2disabled();
251    }
252    return;
253}
254function checkFullName() {
255    var fullName = document.getElementById('full_name').value;
256    var errorFullName = document.getElementById('errorFullName');
257    if (0 == fullName.length) {
258        errorFullName.innerHTML = "<p>お名前は必須です</p>";
259        return false;
260    }
261    if (fullName.length > 20) {
262        errorFullName.innerHTML = "<p>お名前は20文字まで入力可能です</p>";
263        return false;
264    }
265    return true;
266}
267// お名前(姓)
268function inputNameSei() {
269    var ret = checkNameSei();
270    if (ret) {
271        $('#errorNameSei').addClass('js-hide');
272        checkStep2();
273    } else {
274        $('#errorNameSei').removeClass('js-hide');
275        step2disabled();
276    }
277    return;
278}
279function checkNameSei() {
280    var nameSei = document.getElementById('name_sei').value;
281    var errorNameSei = document.getElementById('errorNameSei');
282    if (0 == nameSei.length) {
283        errorNameSei.innerHTML = "<p>お名前(姓)は必須です</p>";
284        return false;
285    }
286    if (nameSei.length > 20) {
287        errorNameSei.innerHTML = "<p>お名前(姓)は20文字まで入力可能です</p>";
288        return false;
289    }
290    return true;
291}
292// お名前(名)
293function inputNameMei() {
294    var ret = checkNameMei();
295    if (ret) {
296        $('#errorNameMei').addClass('js-hide');
297        checkStep2();
298    } else {
299        $('#errorNameMei').removeClass('js-hide');
300        step2disabled();
301    }
302    return;
303}
304function checkNameMei() {
305    var nameMei = document.getElementById('name_mei').value;
306    var errorNameMei = document.getElementById('errorNameMei');
307    if (0 == nameMei.length) {
308        errorNameMei.innerHTML = "<p>お名前(名)は必須です</p>";
309        return false;
310    }
311    if (nameMei.length > 20) {
312        errorNameMei.innerHTML = "<p>お名前(名)は20文字まで入力可能です</p>";
313        return false;
314    }
315    return true;
316}
317// 生まれた年
318function inputBirthdayYear() {
319    var ret = checkBirthdayYear();
320    if (ret) {
321        $('#errorBirthdayYear').addClass('js-hide');
322        checkStep2();
323    } else {
324        $('#errorBirthdayYear').removeClass('js-hide');
325        step2disabled();
326    }
327    return;
328}
329function checkBirthdayYear() {
330    var birthdayYear = document.getElementById('birthday_year').value;
331    var errorBirthdayYear = document.getElementById('errorBirthdayYear');
332    if (birthdayYear == '') {
333        errorBirthdayYear.innerHTML = "<p>生まれた年は必須です</p>";
334        return false;
335    }
336    // 18~65歳の年
337    if (birthYearMin < birthdayYear && birthdayYear < birthYearMax) {
338        return true;
339    } else {
340        errorBirthdayYear.innerHTML = "<p>生まれた年は " + birthYearMin + " ~ " + birthYearMax + " が入力可能です</p>";
341        return false;
342    }
343}
344// 生年月日
345function inputBirthYear() {
346    var birthYear = document.getElementById('birth_year').value;
347    var errorBirth = document.getElementById('errorBirth');
348    if (birthYear == '') {
349        errorBirth.innerHTML = "<p>生年月日(年)は必須です</p>";
350        $('#errorBirth').removeClass('js-hide');
351        step2disabled();
352    } else {
353        // 18~65歳の年
354        if (birthYear < birthYearMin || birthYearMax < birthYear) {
355            errorBirth.innerHTML = "<p>生まれた年は " + birthYearMin + " ~ " + birthYearMax + " が入力可能です</p>";
356            $('#errorBirth').removeClass('js-hide');
357            step2disabled();
358            return false;
359        }
360        var ret = checkBirthday();
361        if (ret == 'skip') {
362            $('#errorBirth').addClass('js-hide');
363            step2disabled();
364            return;
365        } else if (!ret) {
366            $('#errorBirth').removeClass('js-hide');
367            step2disabled();
368            return;
369        } else {
370            $('#errorBirth').addClass('js-hide');
371            checkStep2();
372        }
373    }
374    return;
375}
376function inputBirthMonth() {
377    var birthMonth = document.getElementById('birth_month').value;
378    var errorBirth = document.getElementById('errorBirth');
379    if (birthMonth == '') {
380        errorBirth.innerHTML = "<p>生年月日(月)は必須です</p>";
381        $('#errorBirth').removeClass('js-hide');
382        step2disabled();
383    } else {
384        // 1~12月
385        if (birthMonth < 1 || 12 < birthMonth) {
386            errorBirth.innerHTML = "<p>生年月日(月)が有効ではありません</p>";
387            $('#errorBirth').removeClass('js-hide');
388            step2disabled();
389            return false;
390        }
391        var ret = checkBirthday();
392        if (ret == 'skip') {
393            $('#errorBirth').addClass('js-hide');
394            step2disabled();
395            return;
396        } else if (!ret) {
397            $('#errorBirth').removeClass('js-hide');
398            step2disabled();
399            return;
400        } else {
401            $('#errorBirth').addClass('js-hide');
402            checkStep2();
403        }
404    }
405    return;
406}
407function inputBirthDay() {
408    var birthDay = document.getElementById('birth_day').value;
409    var errorBirth = document.getElementById('errorBirth');
410    if (birthDay == '') {
411        errorBirth.innerHTML = "<p>生年月日(日)は必須です</p>";
412        $('#errorBirth').removeClass('js-hide');
413        step2disabled();
414    } else {
415        // 1~31日
416        if (birthDay < 1 || 31 < birthDay) {
417            errorBirth.innerHTML = "<p>生年月日(日)が有効ではありません</p>";
418            $('#errorBirth').removeClass('js-hide');
419            step2disabled();
420            return false;
421        }
422        var ret = checkBirthday();
423        if (ret == 'skip') {
424            $('#errorBirth').addClass('js-hide');
425            step2disabled();
426            return;
427        } else if (!ret) {
428            $('#errorBirth').removeClass('js-hide');
429            step2disabled();
430            return;
431        } else {
432            $('#errorBirth').addClass('js-hide');
433            checkStep2();
434        }
435    }
436    return;
437}
438function checkBirthday() {
439    var birthYear = document.getElementById('birth_year').value;
440    var birthMonth = document.getElementById('birth_month').value;
441    var birthDay = document.getElementById('birth_day').value;
442    var errorBirth = document.getElementById('errorBirth');
443    if (birthYear != '' && birthMonth != '' && birthDay != '') {
444        // 18~65歳の年
445        if (birthYearMin < birthYear && birthYear < birthYearMax) {
446            // 有効な日付かどうか
447            var dtBirthday = new Date(birthYear, birthMonth - 1, birthDay);
448            if (dtBirthday.getFullYear() == birthYear && dtBirthday.getMonth() == birthMonth - 1 && dtBirthday.getDate() == birthDay) {
449                return true;
450            } else {
451                errorBirth.innerHTML = "<p>生年月日が有効ではありません</p>";
452                return false;
453            }
454        } else {
455            errorBirth.innerHTML = "<p>生年月日(年)は " + birthYearMin + " ~ " + birthYearMax + " が入力可能です</p>";
456            return false;
457        }
458    } else {
459        return 'skip';
460    }
461    return true;
462}
463// メールアドレス
464function inputEmail() {
465    var ret = checkEmail();
466    if (ret) {
467        $('#errorEmail').addClass('js-hide');
468        checkStep2();
469    } else {
470        $('#errorEmail').removeClass('js-hide');
471        step2disabled();
472    }
473    return;
474}
475function checkEmail() {
476    var email = document.getElementById('email').value;
477    var reg = /^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/;
478    var errorEmail = document.getElementById('errorEmail');
479    if (!errorEmail) {
480        return;
481    }
482    var blackListEmail = $('#blacklistMail').val();
483    if (blackListEmail) {
484        if (blackListEmail.indexOf(email) >= 0) {
485            errorEmail.innerHTML = "<p>お使いのメールアドレスでは応募(相談)ができません</p>";
486            return false;
487        }
488    }
489
490    if (0 == email.length) {
491        errorEmail.innerHTML = "<p>メールアドレスは必須です</p>";
492        return false;
493    }
494    if (reg.test(email)) {
495        return true;
496    } else {
497        errorEmail.innerHTML = "<p>メールアドレスは正しい形式で入力してください</p>";
498        return false;
499    }
500    return;
501}
502// STEP2 全体チェック
503function checkStep2() {
504    // お名前(フルネーム) or (姓・名)
505    if (document.getElementById('full_name') != null) {
506        var ret = checkFullName();
507        if (!ret) {
508            step2disabled();
509            return;
510        }
511    }
512    // お名前(姓)
513    if (document.getElementById('name_sei') != null) {
514        var ret = checkNameSei();
515        if (!ret) {
516            step2disabled();
517            return;
518        }
519    }
520    // お名前(名)
521    if (document.getElementById('name_mei') != null) {
522        var ret = checkNameMei();
523        if (!ret) {
524            step2disabled();
525            return;
526        }
527    }
528    // 生まれた年
529    if (document.getElementById('birthday_year') != null) {
530        var ret = checkBirthdayYear();
531        if (!ret) {
532            step2disabled();
533            return;
534        }
535    }
536    // 生年月日
537    if (document.getElementById('birth_year') != null) {
538        var ret = checkBirthday();
539        if (ret == 'skip' || !ret) {
540            step2disabled();
541            return;
542        }
543    }
544    // メールアドレス
545    if (document.getElementById('email') != null) {
546        var ret = checkEmail();
547        if (!ret) {
548            step2disabled();
549            return;
550        }
551    }
552    // エラーなしなので STEP2「次へ進む」ボタン有効化
553    $('#step2Submit').prop('disabled', false);
554    return;
555}
556// STEP2「次へ進む」ボタン無効化
557function step2disabled() {
558    $('#step2Submit').prop('disabled', true);
559    return;
560}
561
562/*
563 * STEP3
564 */
565// 住所(郵便番号:前)
566function inputZip1() {
567    var ret = checkZip1();
568    if (ret) {
569        $('#errorZip1').addClass('js-hide');
570        checkStep3();
571    } else {
572        $('#errorZip1').removeClass('js-hide');
573        step3disabled();
574    }
575    return;
576}
577function checkZip1() {
578    var zip1 = document.getElementById('zip1').value.trim();
579    var errorZip1 = document.getElementById('errorZip1');
580    if (0 == zip1.length) {
581        errorZip1.innerHTML = "<p>郵便番号(前)は必須です</p>";
582        return false;
583    }
584    if (!zip1.match(/^[0-9]+$/)) {
585        errorZip1.innerHTML = "<p>郵便番号(前)は半角数字で入力してください</p>";
586        return false;
587    }
588    if (zip1.length != 3) {
589        errorZip1.innerHTML = "<p>郵便番号(前)は半角数字3文字で入力してください</p>";
590        return false;
591    }
592    return true;
593}
594// 住所(郵便番号:後)
595function inputZip2() {
596    var ret = checkZip2();
597    if (ret) {
598        $('#errorZip2').addClass('js-hide');
599        checkStep3();
600    } else {
601        $('#errorZip2').removeClass('js-hide');
602        step3disabled();
603    }
604    return;
605}
606function checkZip2() {
607    var zip2 = document.getElementById('zip2').value.trim();
608    var errorZip2 = document.getElementById('errorZip2');
609    if (0 == zip2.length) {
610        errorZip2.innerHTML = "<p>郵便番号(後)は必須です</p>";
611        return false;
612    }
613    if (!zip2.match(/^[0-9]+$/)) {
614        errorZip2.innerHTML = "<p>郵便番号(後)は半角数字で入力してください</p>";
615        return false;
616    }
617    if (zip2.length != 4) {
618        errorZip2.innerHTML = "<p>郵便番号(後)は半角数字4文字で入力してください</p>";
619        return false;
620    }
621    return true;
622}
623// 住所(都道府県)
624$(document).on('change blur', '#live_pref', function () {
625    var elementId = $(this).attr('id');
626    var cityId = $(this).attr('data-city-id');
627    if (cityId === undefined) {
628        cityId = 'select_city';
629    }
630    var prefId = document.getElementById(elementId).value;
631    var errorPref = document.getElementById('errorPref');
632    // 都道府県が選択されていない場合
633    if (prefId == "" || prefId == void 0 || prefId == 0) {
634        $("#zip_city").empty();
635        var option = '<option value="">市区町村を選択</option>';
636        $('#zip_city').prepend(option);
637        $('#errorCity').addClass('js-hide');
638        errorPref.innerHTML = "<p>都道府県を選択してください</p>";
639        $('#errorPref').removeClass('js-hide');
640        step3disabled();
641        return false;
642    }
643    $.ajax({
644        url: '/' + location.pathname.split('/')[1] + '/ajax/city/' + prefId,
645        dataType: 'json',
646        async: true,
647        success: function (data) {
648            changeCityList(data, cityId);
649        }
650    });
651    var ret = checkPref();
652    if (ret) {
653        $('#errorPref').addClass('js-hide');
654        checkStep3();
655    } else {
656        $('#errorPref').removeClass('js-hide');
657        step3disabled();
658    }
659    return;
660});
661function checkPref() {
662    var pref = document.getElementById('live_pref').value;
663    var errorPref = document.getElementById('errorPref');
664    if (0 < pref.length) {
665        return true;
666    } else {
667        errorPref.innerHTML = "<p>都道府県を選択してください</p>";
668        return false;
669    }
670}
671// 市区町村リスト生成
672function changeCityList(data, name) {
673    $("#zip_city").empty();
674    var option = '<option value="">市区町村を選択</option>';
675    for (let i = 0; i < data.length; i++) {
676        if (data[i].name === name) {
677            option = option + "<option value =" + data[i].id + " selected>" + data[i].name + "</option>";
678            var select_city_id = data[i].id;
679        }
680        else {
681            option = option + "<option value =" + data[i].id + ">" + data[i].name + "</option>";
682        }
683    }
684    $('#zip_city').prepend(option).change();
685    return;
686}
687// 住所(市区町村)
688$(document).on('change blur', '#zip_city', function () {
689    var cityId = document.getElementById('zip_city').value;
690    var errorCity = document.getElementById('errorCity');
691    // 都道府県が選択されていない場合
692    if (cityId == "" || cityId == void 0 || cityId == 0) {
693        var option = '<option value="">市区町村を選択</option>';
694        $('#errorCity').addClass('js-hide');
695        errorPref.innerHTML = "<p>都道府県を選択してください</p>";
696        $('#errorCity').removeClass('js-hide');
697        step3disabled();
698        return false;
699    }
700    var ret = checkCity();
701    if (ret) {
702        $('#errorCity').addClass('js-hide');
703        checkStep3();
704    } else {
705        $('#errorCity').removeClass('js-hide');
706        step3disabled();
707    }
708    return;
709});
710function checkCity() {
711    var city = document.getElementById('zip_city').value;
712    var errorCity = document.getElementById('errorCity');
713    if (0 < city.length) {
714        return true;
715    } else {
716        errorCity.innerHTML = "<p>市区町村を選択してください</p>";
717        return false;
718    }
719}
720// 電話番号
721function inputTelephone() {
722    var ret = checkTelephone();
723    if (ret) {
724        $('#errorTelephone').addClass('js-hide');
725        checkStep3();
726    } else {
727        $('#errorTelephone').removeClass('js-hide');
728        step3disabled();
729    }
730    return;
731}
732function checkTelephone() {
733    var telephone = document.getElementById('telephone').value.replace(/[━.*‐.*―.*-.*\-.*ー.*\-]/gi, '');
734    var errorTelephone = document.getElementById('errorTelephone');
735    var blackListTel = $('#blacklistTel').val();
736    if (blackListTel) {
737        if (blackListTel.indexOf(telephone) >= 0) {
738            errorTelephone.innerHTML = "<p>お使いの電話番号では応募(相談)はできません</p>";
739            return false;
740        }
741    }
742    if (0 == telephone.length) {
743        errorTelephone.innerHTML = "<p>電話番号は必須です</p>";
744        return false;
745    }
746    if (!telephone.match(/^(0[5-9]0[0-9]{8}|0[1-9][1-9][0-9]{7})$/)) {
747        errorTelephone.innerHTML = "<p>電話番号が有効ではありません</p>";
748        return false;
749    } else {
750        return true;
751    }
752}
753// その他
754function inputOtherText() {
755    let letterLength = document.getElementById('otherText').value.length;
756    var errorOtherText = document.getElementById('errorOtherText');
757    if (letterLength !== 0) {
758        if (letterLength > 1000) {
759            errorOtherText.innerHTML = "<p>こちらは1000文字まで入力可能です</p>";
760            $('#errorOtherText').removeClass('js-hide');
761            step3disabled();
762        } else {
763            $('#errorOtherText').addClass('js-hide');
764        }
765    }
766    var ret = checkOtherText();
767    if (ret) {
768        $('#errorOtherText').addClass('js-hide');
769        checkStep3();
770    } else {
771        $('#errorOtherText').removeClass('js-hide');
772        step3disabled();
773    }
774    return;
775}
776function checkOtherText() {
777    var otherText = document.getElementById('otherText').value;
778    var errorOtherText = document.getElementById('errorOtherText');
779    if (otherText.length > 1000) {
780        errorOtherText.innerHTML = "<p>こちらは1000文字まで入力可能です</p>";
781        return false;
782    }
783    return true;
784}
785// 選択の場合
786function changeRequiredCheckbox() {
787    var ret = checkRequiredCheckbox();
788    if (ret) {
789        $('#errorRequiredCheckbox').addClass('js-hide');
790        checkStep3();
791    } else {
792        $('#errorRequiredCheckbox').removeClass('js-hide');
793        step3disabled();
794    }
795    return;
796}
797// 択一選択・複数選択の場合
798function checkRequiredCheckbox() {
799    var errorOption = document.getElementById('errorRequiredCheckbox');
800    // 選択されているかどうか取得
801    var elements = document.getElementsByName('required_checkbox');
802    var check = false;
803    if (elements[0].checked) {
804        check = true;
805    }
806    if (!check) {
807        errorOption.innerHTML = "<p>チェックボックスにチェックを入れてください</p>";
808        $('#errorRequiredCheckbox').removeClass('js-hide');
809        return false;
810    }
811    return true;
812}
813// STEP3 全体チェック
814function checkStep3() {
815    // 住所(郵便番号:前)
816    if (document.getElementById('zip1') != null) {
817        var ret = checkZip1();
818        if (!ret) {
819            step3disabled();
820            return;
821        }
822    }
823    // 住所(郵便番号:後)
824    if (document.getElementById('zip2') != null) {
825        var ret = checkZip2();
826        if (!ret) {
827            step3disabled();
828            return;
829        }
830    }
831    // 住所(都道府県)
832    if (document.getElementById('live_pref') != null) {
833        var ret = checkPref();
834        if (!ret) {
835            step3disabled();
836            return;
837        }
838    }
839    // 住所(市区町村)
840    if (document.getElementById('zip_city') != null) {
841        var ret = checkCity();
842        if (!ret) {
843            step3disabled();
844            return;
845        }
846    }
847    // 電話番号
848    if (document.getElementById('telephone') != null) {
849        var ret = checkTelephone();
850        if (!ret) {
851            step3disabled();
852            return;
853        }
854    }
855    // その他
856    if (document.getElementById('otherText') != null) {
857        var ret = checkOtherText();
858        if (!ret) {
859            step3disabled();
860            return;
861        }
862    }
863    // 必須チェックボックス
864    if (document.getElementById('required_checkbox') != null) {
865        var ret = checkRequiredCheckbox();
866        if (!ret) {
867            step3disabled();
868            return;
869        }
870    }
871    // エラーなしなので STEP3「送信」ボタン有効化
872    $('#completeBtn').prop('disabled', false);
873    return;
874}
875// STEP3「送信」ボタン無効化
876function step3disabled() {
877    $('#completeBtn').prop('disabled', true);
878    return;
879}
880
881/*
882 * ページ移動
883 */
884$(document).on('submit', '.js-entry_form', function (e) {
885    e.preventDefault();
886    var step = $(this).data('step');
887    var url = $(this).attr('action');
888    if (step <= 3) {
889        submitForm(step, url);
890    } else {
891        submitComplete(url);
892    }
893});
894// 次のステップへ
895function submitForm(step, url) {
896    var form = $('#form').get(0);
897    var formData = new FormData(form);
898    $.ajax({
899        url: url,
900        data: formData,
901        type: 'POST',
902        processData: false,
903        contentType: false,
904        dataType: 'json',
905    }).done(function (data) {
906        $("#includeArea").html(data.html);
907        setScroll();
908        if (data.result !== undefined && !data.result) {
909            step--;
910        }
911        if (step == 1) { checkStep1(); }
912        if (step == 2) { checkStep2(); }
913        if (step == 3) { setStep3(); checkStep3(); }
914    })
915}
916// 戻るボタン
917function submitBack(step) {
918    var url = '/' + location.pathname.split('/')[1] + '/entry/form/back/' + step;
919    $.post(url, $("#form").serialize(), function (data) {
920        $("#includeArea").html(data.html);
921        setScroll();
922        if (step == 1) { checkStep1(); }
923        if (step == 2) { checkStep2(); }
924        if (step == 3) { checkStep3(); }
925    });
926}
927// 完了ボタン
928function submitComplete(url) {
929    var cancelFlag = false;
930    //ボタン無効化
931    if (cancelFlag == false) {
932        $('#completeBtn').prop('disabled', true).addClass('sending');
933        cancelFlag = true;
934        //処理内容
935        $.post(url, $("#form").serialize(), function (data) {
936            // エラーがない
937            if (data.result) {
938                // 完了画面へ遷移
939                // location.pathname の最初の部分のみを取得
940                // 例)/kango/content/ouen_D → /kango
941                const firstSegment = location.pathname.split('/').filter(Boolean)[0]; // 'kango'
942
943                // 新しい URL を作成
944                const newUrl = location.origin + `/${firstSegment}/entry/form/complete`;
945
946                // 現在のページをリダイレクト
947                location.href = newUrl;
948            } else {
949                // エラーがあった場合
950                $("#includeArea").html(data.html);
951                setScroll();
952                setStep3();
953                //ボタン有効化
954                setTimeout(function () {
955                    $('#completeBtn').prop('disabled', false).removeClass('sending');
956                    cancelFlag = false;
957                }, 1000);
958            }
959        });
960    }
961}
962// スクロール設定
963function setScroll() {
964    var winW = $(window).width();
965    var devW = 768;
966    if (winW <= devW) {
967        // SP版
968        var headerH = $('.headerSp').height();
969        var offset = $('#includeArea').offset() || { top: 0, left: 0 };
970        if (typeof headerH === 'undefined') {
971            var offset = $('#entryForm').offset() || { top: 0, left: 0 };
972            $(window).scrollTop(offset.top);
973        } else {
974            // LPコンテンツ対応
975            $(window).scrollTop(offset.top - headerH);
976        }
977    } else {
978        // PC版
979        var offset = $('#entryForm').offset() || { top: 0, left: 0 };
980        $(window).scrollTop(offset.top);
981    }
982    return;
983}
984// プレースホルダーを全文表示させるためのテキストエリアの高さ調節
985function setStep3() {
986    var $otherText = document.getElementById("otherText");
987    if ($otherText) {
988        // SP判とPC版で分岐
989        if ($(window).width() < 768) {
990            $otherText.rows = 7;
991        } else {
992            $otherText.rows = 3;
993        }
994    }
995    return;
996}

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.