[英]Struts2 s:checkbox - unwanted input type hidden
My code: 我的代码:
<label class="btn btn-default">
<s:checkbox name="viewTypeDescr" /> 
<s:text name="name.contentType" />
</label>
The docs: http://struts.apache.org/release/2.3.x/docs/checkbox.html say that it will render a input[type=checkbox]
文档: http : //struts.apache.org/release/2.3.x/docs/checkbox.html说它将呈现input[type=checkbox]
Instead here's what I get: 相反,这是我得到的:
<label class="btn btn-default">
<input type="checkbox" name="viewTypeDescr" value="true" id="search_viewTypeDescr">
<input type="hidden" id="__checkbox_search_viewTypeDescr" name="__checkbox_viewTypeDescr" value="true">
Content Type
</label>
That added input[type="hidden"]
is making the resulting page invalid because a label can have max 1 input inside. 添加input[type="hidden"]
使得结果页面无效,因为标签内部可以有最多1个输入。
Definition of invalid: 无效的定义:
<html><head><title>foo</title></head><body>
and </body></html>
to lessen the false errors 装饰它缺少<html><head><title>foo</title></head><body>
和</body></html>
以减少错误错误 Anyway, when you submit your document to QA for validation, they use validator.w3.org and that is all that matters. 无论如何,当您将文档提交给QA进行验证时,他们会使用validator.w3.org,这就是最重要的。
What's the reason of that hidden? 隐藏的原因是什么? How could I get rid of it or move it elsewhere? 我怎么能摆脱它或移动到其他地方?
I created a new theme, with parent=simple, and will use that. 我用parent = simple创建了一个新主题,并将使用它。
Still don't know what's the supposed purpose of that hidden... 仍然不知道隐藏的假设目的是什么......
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.