remove old route for /search and fix issue where searching for empty string was failing

This commit is contained in:
2022-01-30 23:42:38 +11:00
parent 2e8de89a6a
commit e022b49a92
2 changed files with 11 additions and 11 deletions

View File

@@ -25,6 +25,15 @@
.highlight { box-shadow: 0 0 7px 4px #5bc0de }
.sm-txt { font-size: 0.7rem }
</style>
<script>
function HandleSearch()
{
st=$('#search_term').val();
if( st != '' ) {
document.location.href='/search/'+st
}
}
</script>
</head>
<body>
@@ -103,9 +112,9 @@
</a>
</div class="nav-item">
<form class="d-flex col ms-5" method="POST" action="/search">
<form class="d-flex col ms-5" method="POST" onSubmit="HandleSearch(); return false">
<input id="search_term" class="form-control" type="search" placeholder="by file, date (YYYMMDD) or tag" aria-label="Search" name="search_term">
<button class="btn btn-outline-success" onClick="javascript:st=$('#search_term').val(); document.location.href='/search/'+st" type="button">Search</button>
<button class="btn btn-outline-success" onClick="HandleSearch()" type="button">Search</button>
</form>
<div class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-bs-toggle="dropdown" aria-expanded="false">