<p> inside a <label> (not allowed) is in bootstrap3 templates
See original GitHub issueI’m validating my html for my website and I’ve found a case where crispy is emitting something technically invalid (this is output from my html5 validator):
CRITICAL: >>>> <p id="hint_id_archived" class="help-block">blah blah blah</p> </label> </div> </div> </div> <div id="div_id_default_baseline" class="form-group"> <label for="id_default_baseline" class="control-label col-lg-2">
CRITICAL: >>>> ^ ^
CRITICAL: error: Element “p” not allowed as child of element “label” in this context. (Suppressing further errors from this subtree.)
I’m having a hard time searching through the bootstrap3 crispy templates and finding exactly where it is happening …
CRISPY_TEMPLATE_PACK = ‘bootstrap3’
I’m using 1.6.0
It isn’t a huge deal as the page is perfectly viewable, it’s just strictly incorrect.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Bootstrap 3: Why nesting inputs inside labels? - Stack Overflow
The answer is user-experience. Nesting your radio or checkbox inputs inside a <label> provides additional functionality. Consider:
Read more >Forms - Bootstrap
Examples and usage guidelines for form control styles, layout options, and custom components for creating a wide variety of forms.
Read more >HTML label tag - W3Schools
The <label> tag defines a label for several elements: ... A label can also be bound to an element by placing the element...
Read more >10 Most Common Bootstrap Mistakes That Developers Make
This may be because it is not clearly advertised on the Bootstrap site, or because people don't take enough time to read the...
Read more >Bootstrap Textarea input free examples, templates & tutorial
The name attribute is needed to reference the form data after the form is submitted (if you omit the name attribute, no data...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks!! – I just found I can do that in requirements.txt as well and am just pointing to a revision on my fork for now.
I see you guys are also working on a test framework – in case you want to validate your fragments, I’ve been investigating various html5 validators and narrowed down my choices either to https://html5.validator.nu/, which either can be run from a jar (slow, but simple, has optional json output), a local webservice using the jar, or using the online REST service. Alternatively there is also a nodejs based mozilla validator.
I went with validator.nu locally as a jar.
Oh, nevermind – validator.nu doesn’t do fragments. Could have sworn it did…