question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

<p> inside a <label> (not allowed) is in bootstrap3 templates

See original GitHub issue

I’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.)

image

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:closed
  • Created 7 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rrauenzacommented, Sep 20, 2016

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.

0reactions
rrauenzacommented, Sep 20, 2016

Oh, nevermind – validator.nu doesn’t do fragments. Could have sworn it did…

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found