Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 输入按钮在Wordpress(引导)中不工作_Php_Html_Wordpress_Twitter Bootstrap_Submit - Fatal编程技术网

Php 输入按钮在Wordpress(引导)中不工作

Php 输入按钮在Wordpress(引导)中不工作,php,html,wordpress,twitter-bootstrap,submit,Php,Html,Wordpress,Twitter Bootstrap,Submit,我是PHP新手。我正在尝试使用引导样式为Wordress制作一个小插件。问题是表单中的提交输入元素在表单被包装在标记中之前不起作用(不可单击)。然后它就可以正常工作了(参见下面的代码) 试验 有人能解释一下发生了什么事吗?为什么没有输入就不能工作?正如我在评论中所说的,缺少的结尾“>”会弄乱html,因此您无法提交表单。这就是为什么: 最初,您说除非将表单包装成“td”,否则无法提交表单。由于缺少结束标记,浏览器呈现的html不会捕获表单标记。它只解析如下所示的html: <div c

我是PHP新手。我正在尝试使用引导样式为Wordress制作一个小插件。问题是表单中的提交输入元素在表单被包装在
标记中之前不起作用(不可单击)。然后它就可以正常工作了(参见下面的代码)


试验

有人能解释一下发生了什么事吗?为什么没有
输入就不能工作?

正如我在评论中所说的,缺少的结尾“>”会弄乱html,因此您无法提交表单。这就是为什么:

最初,您说除非将表单包装成“td”,否则无法提交表单。由于缺少结束标记,浏览器呈现的html不会捕获表单标记。它只解析如下所示的html:

<div class="col-sm-7" form method="post" action="">
<!-- 
I specifically removed the "<" so you will see it better. 
With this html, there is no form, only a div with multiple attributes. 
-->
即使使用了用于使表单工作的“hack”,您的html仍然无效,因为您现在在末尾有一个额外的结束符
,即不结束任何内容


当您正确关闭
div

时,您可以删除
td
。您忘记了第8行的关闭“>:谢谢!我已修复,输入开始工作!但我还是想知道。。。html中与输入本身无关的错误是如何影响其功能的?更多信息,请查看我发布的答案。
<div class="col-sm-7" td > 
<!-- 
I missed the "<" again so you could understand better.
The closing tag of the "td" is in fact closing the "div"
which makes the html form valid and the button will in fact submit the form.
-->
<form method="post" action="">
...
</form>
<div class="col-sm-7" td > 
<!-- 
I missed the "<" again so you could understand better.
The closing tag of the "td" is in fact closing the "div"
which makes the html form valid and the button will in fact submit the form.
-->
<form method="post" action="">
...
</form>