メニューを切り替える
個人設定メニューを切り替える
個人メニューを切り替える
ログインしていません
編集を行うと、IPアドレスが公開されます。

「飲食店検索」の版間の差分

提供: 川西図鑑
編集の要約なし
編集の要約なし
3行目: 3行目:
<html>
<html>
<form method="get" action="" id="searchForm">
<form method="get" action="" id="searchForm">
   <input type="text" name="検索" placeholder="店名・住所・ジャンルなど" style="width:300px;" />
   <input type="text" name="検索" placeholder="店名・住所・ジャンルなど" style="width:300px;" id="searchText" />
   <select name="ジャンル" style="margin-left:8px;" id="genre">
   <select name="ジャンル" style="margin-left:8px;" id="genre">
  <option value="">すべてのジャンル</option>
  <option value="">すべてのジャンル</option>
29行目: 29行目:
<script>
<script>
document.getElementById('searchForm').addEventListener('submit', function(e) {
document.getElementById('searchForm').addEventListener('submit', function(e) {
  const searchText = document.getElementById('searchText');
   const genre = document.getElementById('genre');
   const genre = document.getElementById('genre');
  if (searchText.value === '') {
    searchText.removeAttribute('name'); // 空のとき name属性を削除
  }
   if (genre.value === '') {
   if (genre.value === '') {
     genre.removeAttribute('name'); // 空のとき name属性を削除
     genre.removeAttribute('name'); // 空のとき name属性を削除

2025年10月27日 (月) 16:02時点における版

検索条件

検索結果

エラー: テーブル店舗情報が見つかりません。