The code is to receive a text and search database, below code work well
<form method="GET" action="{% url 'search:search' %}">
<input placeholder="Search">
<button type="submit">{% trans "Search" %}</button>
</form>
However I decided to change UI, but after form submission, Django does not getting entered text
<form class="example" method="GET" action="{% url 'search:search' %}">
<input type="text" placeholder="Search" name="search">
<button type="submit"><i class="fa fa-search"></i></button>
</form>
I am using Django Oscar library, https://github.com/django-oscar/django-oscar/blob/master/src/oscar/templates/oscar/partials/search.html
<form class="example" method="GET" action="{% url 'search:search' %}">
<input name="q" type="text" placeholder="Search.." name="search">
<button type="submit"><i class="fa fa-search"></i></button>
</form>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.