Currently, I am working on implementing a search bar for one of my websites hosted on Github. Below is the code I have written for the search bar:
<!-- HTML for SEARCH BAR -->
<div id="header">
<form id="newsearch" method="get" action="https://itac85.github.io/Basic-Search-Engine">
<input type="text" class="textinput" name="search" size="21" maxlength="120"><input type="submit" value="Search!" class="button">
</form>
<div class="tfclear"></div>
</div>
After implementation, I noticed that it automatically adds /?search=whatever
to the URL, which leads to the link not functioning properly.
Changing method="get"
to method="post"
resulted in a 405 Not Allowed error from GitHub.
I'm looking for a solution (using html, css, and/or JavaScript) to either completely remove the ?
or alter it to something like search?search=whatever
.