I am developing a Wordpress theme, and I put the form into searchform.php, and included in my header with:
<?php get_search_form(); ?>
But, it's working only if I include a button. I tried to put the button and hide it with css, but it's not working. I put the same form in an empty html file, and it worked. I tried to remove the scripts my theme loads, and it didnt work again, so I think the problem is at Wordpress. Wordpress is not letting me submit the search form with ENTER. Does anyone have a solution?
This is the code generated:
<form role="search" method="get" id="searchform" action="http://localhost/wp/">
<input type="text" name="s" id="s" class="search" placeholder="Search..." onunfocus="send()">
</form>
Thanks.
A plugin was causing this to happen. It cost me a full day. Thanks those who tried anyways.
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.