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]
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.
Definition of invalid:
<html><head><title>foo</title></head><body>
and </body></html>
to lessen the false errors Anyway, when you submit your document to QA for validation, they use validator.w3.org and that is all that matters.
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.
Still don't know what's the supposed purpose of that hidden...
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.