{% endhighlight %}
+ <h2 id="forms-help-text">Help text</h2>
+ <p>Block level help text for form controls.</p>
+ <div class="bs-callout bs-callout-info" id="callout-help-text-accessibility">
+ <h4>Associating help text with form controls</h4>
+ <p>Help text should be explicitly associated with the form control it relates to using the <code>aria-describedby</code> attribute. This will ensure that assistive technologies – such as screen readers – will announce this help text when the user focuses or enters the control.</p>
+ </div>
+ <div class="bs-example" data-example-id="simple-help-text">
+ <form>
+ <div class="form-group">
+ <label for="inputHelpBlock">Input with help text</label>
+ <input type="text" id="inputHelpBlock" class="form-control" aria-describedby="helpBlock">
+ </div>
+ <span id="helpBlock" class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>
+ </form>
+ </div><!-- /.bs-example -->
+{% highlight html %}
+<label class="sr-only" for="inputHelpBlock">Input with help text</label>
+<input type="text" id="inputHelpBlock" class="form-control" aria-describedby="helpBlock">
+...
+<span id="helpBlock" class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>
+{% endhighlight %}
+</div>
+
+
<h2 id="forms-control-validation">Validation states</h2>
<p>Bootstrap includes validation styles for error, warning, and success states on form controls. To use, add <code>.has-warning</code>, <code>.has-error</code>, or <code>.has-success</code> to the parent element. Any <code>.control-label</code>, <code>.form-control</code>, and <code>.help-block</code> within that element will receive the validation styles.</p>
<form>
<div class="form-group has-success">
<label class="control-label" for="inputSuccess1">Input with success</label>
- <input type="text" class="form-control" id="inputSuccess1">
+ <input type="text" class="form-control" id="inputSuccess1" aria-describedby="helpBlock2">
+ <span id="helpBlock2" class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>
</div>
<div class="form-group has-warning">
<label class="control-label" for="inputWarning1">Input with warning</label>
{% highlight html %}
<div class="form-group has-success">
<label class="control-label" for="inputSuccess1">Input with success</label>
- <input type="text" class="form-control" id="inputSuccess1">
+ <input type="text" class="form-control" id="inputSuccess1" aria-describedby="helpBlock2">
+ <span id="helpBlock2" class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>
</div>
<div class="form-group has-warning">
<label class="control-label" for="inputWarning1">Input with warning</label>
</div>
{% endhighlight %}
- <h2 id="forms-help-text">Help text</h2>
- <p>Block level help text for form controls.</p>
- <div class="bs-callout bs-callout-info" id="callout-help-text-accessibility">
- <h4>Associating help text with form controls</h4>
- <p>Help text should be explicitly associated with the form control it relates to using the <code>aria-describedby</code> attribute. This will ensure that assistive technologies – such as screen readers – will announce this help text when the user focuses or enters the control.</p>
- </div>
- <div class="bs-example" data-example-id="simple-help-text">
- <form>
- <div class="form-group">
- <label for="inputHelpBlock">Input with help text</label>
- <input type="text" id="inputHelpBlock" class="form-control" aria-describedby="helpBlock">
- </div>
- <span id="helpBlock" class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>
- </form>
- </div><!-- /.bs-example -->
-{% highlight html %}
-<label class="sr-only" for="inputHelpBlock">Input with help text</label>
-<input type="text" id="inputHelpBlock" class="form-control" aria-describedby="helpBlock">
-...
-<span id="helpBlock" class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>
-{% endhighlight %}
-</div>