|
|
| 57行目: |
57行目: |
| {{{end template}}} | | {{{end template}}} |
|
| |
|
| <script>
| |
| document.addEventListener("DOMContentLoaded", function () {
| |
| const zipInput = document.getElementById("zipcode");
| |
| const addressInput = document.getElementById("address");
| |
|
| |
| zipInput.addEventListener("input", function () {
| |
| // 数字のみ・7桁制限
| |
| const zip = this.value.replace(/[^0-9]/g, "").slice(0, 7);
| |
| this.value = zip;
| |
|
| |
| if (zip.length === 7) {
| |
| fetch(`https://zipcloud.ibsnet.co.jp/api/search?zipcode=${zip}`)
| |
| .then(response => response.json())
| |
| .then(data => {
| |
| if (data.results) {
| |
| const r = data.results[0];
| |
| // 川西市だけ許可
| |
| if (r.address1 === "兵庫県" && r.address2 === "川西市") {
| |
| addressInput.value = r.address1 + r.address2 + r.address3;
| |
| } else {
| |
| addressInput.value = "";
| |
| alert("兵庫県川西市以外の住所は対象外です。");
| |
| }
| |
| } else {
| |
| addressInput.value = "";
| |
| alert("該当する住所が見つかりません。");
| |
| }
| |
| })
| |
| .catch(err => {
| |
| console.error("郵便番号検索エラー:", err);
| |
| alert("住所取得に失敗しました。");
| |
| });
| |
| }
| |
| });
| |
| });
| |
| </script>
| |
| '''自由形式テキスト:''' | | '''自由形式テキスト:''' |
|
| |
|
| {{{standard input|free text|rows=10}}} | | {{{standard input|free text|rows=10}}} |
| </includeonly> | | </includeonly> |
2025年10月24日 (金) 10:50時点における版
これは「店舗/飲食店」フォームです。
このフォームを使用してページを作成するには、下にページ名を入力してください。
その名前のページが既に存在する場合は、そのページを編集するフォームに転送されます。