简体   繁体   English

使用ENTER键提交的Wordpress表单不起作用

[英]Wordpress form submit with ENTER key is not working

I am developing a Wordpress theme, and I put the form into searchform.php, and included in my header with: 我正在开发Wordpress主题,并将表单放入searchform.php中,并包含在我的标头中并带有:

<?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. 我试图放按钮并用CSS隐藏它,但是它不起作用。 I put the same form in an empty html file, and it worked. 我将相同的表单放在一个空的html文件中,并且可以正常工作。 I tried to remove the scripts my theme loads, and it didnt work again, so I think the problem is at Wordpress. 我试图删除主题加载的脚本,但该脚本无法再使用,因此我认为问题出在Wordpress。 Wordpress is not letting me submit the search form with ENTER. Wordpress不允许我使用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. 谢谢那些尝试过的人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM