PageSourceSearch

https://kanryu.co.jp/structyu6ipls8/wp-content/themes/kanryu/assets/js/form.js

js kanryu.co.jp collected 2026-10-08 21:43:42 UTC 2,648 bytes, 117 lines download raw bytes

1
2{
3  const form = document.querySelector(".contact-form");
4
5  const inquirySelect = form?.querySelector(
6    'select[name="inquiry_category"]'
7  );
8
9  const inquiryRadioList = form?.querySelector(
10    'input[name="inquiry_detail"]'
11  )?.closest("ul");
12
13  if (inquirySelect && inquiryRadioList) {
14
15    const inquiryOptions = {
16      "": [],
17
18      "建設サービスに関して": [
19        "技術・サービスについて",
20        "情報提供",
21        "採用について",
22        "その他",
23      ],
24
25      "防災安全サービスに関して": [
26        "技術・サービスについて",
27        "ECサイトについて",
28        "情報提供",
29        "採用について",
30        "その他",
31      ],
32
33      "かぐやロードに関して": [
34        "技術・サービスについて",
35        "情報提供",
36        "採用について",
37        "その他",
38      ],
39
40      "採用に関して": [
41        "採用について",
42        "個人情報保護に関するお問い合わせ",
43        "その他",
44      ],
45
46      "IRに関して": [
47        "IR",
48      ],
49
50      "その他": [
51        "その他",
52      ],
53    };
54
55    const updateInquiryRadioList = (reset = false) => {
56
57      const selectedValue = inquirySelect.value;
58
59      const visibleOptions =
60        inquiryOptions[selectedValue] || [];
61
62      // Limpar seleção quando o select mudar
63      if (reset) {
64        inquiryRadioList
65          .querySelectorAll('input[name="inquiry_detail"]')
66          .forEach((radio) => {
67            radio.checked = false;
68          });
69      }
70
71      inquiryRadioList.querySelectorAll("li").forEach((li) => {
72
73        const text = li.querySelector(".txt")
74          ?.textContent.trim();
75
76        if (visibleOptions.includes(text)) {
77          li.style.display = "";
78        } else {
79          li.style.display = "none";
80
81          const radio = li.querySelector(
82            'input[name="inquiry_detail"]'
83          );
84
85          if (radio) {
86            radio.checked = false;
87          }
88        }
89      });
90
91      inquiryRadioList.style.display =
92        visibleOptions.length > 0 ? "flex" : "none";
93
94      // Ocultar a mensagem quando o campo estiver escondido
95      const wrap = inquiryRadioList.closest(
96        ".wpcf7-form-control-wrap"
97      );
98
99      const errorMessage = wrap?.querySelector(
100        ".wpcf7-not-valid-tip"
101      );
102
103      if (errorMessage) {
104        errorMessage.style.display =
105          visibleOptions.length > 0 ? "" : "none";
106      }
107    };
108
109    inquirySelect.addEventListener("change", () => {
110      updateInquiryRadioList(true);
111    });
112
113    updateInquiryRadioList();
114  }
115}
116
117

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.