Skip to content

Commit 39d9bc9

Browse files
committed
2 parents 709a077 + 10cc97c commit 39d9bc9

File tree

4 files changed

+72
-30
lines changed

4 files changed

+72
-30
lines changed

docs/_includes/components/input-groups.html

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="bs-docs-section">
22
<h1 id="input-groups" class="page-header">Input groups</h1>
33

4-
<p class="lead">Extend form controls by adding text or buttons before, after, or on both sides of any text-based <code>&lt;input&gt;</code>. Use <code>.input-group</code> with an <code>.input-group-addon</code> to prepend or append elements to a single <code>.form-control</code>.</p>
4+
<p class="lead">Extend form controls by adding text or buttons before, after, or on both sides of any text-based <code>&lt;input&gt;</code>. Use <code>.input-group</code> with an <code>.input-group-addon</code> or <code>.input-group-btn</code> to prepend or append elements to a single <code>.form-control</code>.</p>
55

66
<div class="bs-callout bs-callout-danger" id="callout-inputgroup-text-input-only">
77
<h4>Textual <code>&lt;input&gt;</code>s only</h4>
@@ -24,7 +24,7 @@ <h4>Always add labels</h4>
2424

2525
<h2 id="input-groups-basic">Basic example</h2>
2626
<p>Place one add-on or button on either side of an input. You may also place one on both sides of an input.</p>
27-
<p><strong class="text-danger">We do not support multiple add-ons on a single side.</strong></p>
27+
<p><strong class="text-danger">We do not support multiple add-ons (<code>.input-group-addon</code> or <code>.input-group-btn</code>) on a single side.</strong></p>
2828
<p><strong class="text-danger">We do not support multiple form-controls in a single input group.</strong></p>
2929
<form class="bs-example bs-example-form" data-example-id="simple-input-groups">
3030
<div class="input-group">
@@ -108,7 +108,6 @@ <h2 id="input-groups-sizing">Sizing</h2>
108108
</div>
109109
{% endhighlight %}
110110

111-
112111
<h2 id="input-groups-checkboxes-radios">Checkboxes and radio addons</h2>
113112
<p>Place any checkbox or radio option within an input group's addon instead of text.</p>
114113
<form class="bs-example bs-example-form" data-example-id="input-group-with-checkbox-radio">
@@ -152,7 +151,6 @@ <h2 id="input-groups-checkboxes-radios">Checkboxes and radio addons</h2>
152151
</div><!-- /.row -->
153152
{% endhighlight %}
154153

155-
156154
<h2 id="input-groups-buttons">Button addons</h2>
157155
<p>Buttons in input groups are a bit different and require one extra level of nesting. Instead of <code>.input-group-addon</code>, you'll need to use <code>.input-group-btn</code> to wrap the buttons. This is required due to default browser styles that cannot be overridden.</p>
158156
<form class="bs-example bs-example-form" data-example-id="input-group-with-button">
@@ -197,7 +195,6 @@ <h2 id="input-groups-buttons">Button addons</h2>
197195
{% endhighlight %}
198196

199197
<h2 id="input-groups-buttons-dropdowns">Buttons with dropdowns</h2>
200-
<p></p>
201198
<form class="bs-example bs-example-form" data-example-id="input-group-dropdowns">
202199
<div class="row">
203200
<div class="col-lg-6">
@@ -324,5 +321,45 @@ <h2 id="input-groups-buttons-segmented">Segmented buttons</h2>
324321
<!-- Button and dropdown menu -->
325322
</div>
326323
</div>
324+
{% endhighlight %}
325+
326+
<h2 id="input-groups-buttons-multiple">Multiple buttons</h2>
327+
<p>While you can only have one add-on per side, you can have multiple buttons inside a single <code>.input-group-btn</code>.</p>
328+
<form class="bs-example bs-example-form" data-example-id="input-group-multiple-buttons">
329+
<div class="row">
330+
<div class="col-lg-6">
331+
<div class="input-group">
332+
<div class="input-group-btn">
333+
<button type="button" class="btn btn-default" aria-label="Bold"><span class="glyphicon glyphicon-bold"></span></button>
334+
<button type="button" class="btn btn-default" aria-label="Italic"><span class="glyphicon glyphicon-italic"></span></button>
335+
</div>
336+
<input type="text" class="form-control" aria-label="Text input with multiple buttons">
337+
</div><!-- /.input-group -->
338+
</div><!-- /.col-lg-6 -->
339+
<div class="col-lg-6">
340+
<div class="input-group">
341+
<input type="text" class="form-control" aria-label="Text input with multiple buttons">
342+
<div class="input-group-btn">
343+
<button type="button" class="btn btn-default" aria-label="Help"><span class="glyphicon glyphicon-question-sign"></span></button>
344+
<button type="button" class="btn btn-default">Action</button>
345+
</div>
346+
</div><!-- /.input-group -->
347+
</div><!-- /.col-lg-6 -->
348+
</div><!-- /.row -->
349+
</form>
350+
{% highlight html %}
351+
<div class="input-group">
352+
<div class="input-group-btn">
353+
<!-- Buttons -->
354+
</div>
355+
<input type="text" class="form-control" aria-label="...">
356+
</div>
357+
358+
<div class="input-group">
359+
<input type="text" class="form-control" aria-label="...">
360+
<div class="input-group-btn">
361+
<!-- Buttons -->
362+
</div>
363+
</div>
327364
{% endhighlight %}
328365
</div>

docs/_includes/css/forms.html

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,30 @@ <h2 id="forms-control-readonly">Readonly state</h2>
609609
{% endhighlight %}
610610

611611

612+
<h2 id="forms-help-text">Help text</h2>
613+
<p>Block level help text for form controls.</p>
614+
<div class="bs-callout bs-callout-info" id="callout-help-text-accessibility">
615+
<h4>Associating help text with form controls</h4>
616+
<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>
617+
</div>
618+
<div class="bs-example" data-example-id="simple-help-text">
619+
<form>
620+
<div class="form-group">
621+
<label for="inputHelpBlock">Input with help text</label>
622+
<input type="text" id="inputHelpBlock" class="form-control" aria-describedby="helpBlock">
623+
</div>
624+
<span id="helpBlock" class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>
625+
</form>
626+
</div><!-- /.bs-example -->
627+
{% highlight html %}
628+
<label class="sr-only" for="inputHelpBlock">Input with help text</label>
629+
<input type="text" id="inputHelpBlock" class="form-control" aria-describedby="helpBlock">
630+
...
631+
<span id="helpBlock" class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>
632+
{% endhighlight %}
633+
</div>
634+
635+
612636
<h2 id="forms-control-validation">Validation states</h2>
613637
<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>
614638

@@ -622,7 +646,8 @@ <h4>Conveying validation state to assistive technologies and colorblind users</h
622646
<form>
623647
<div class="form-group has-success">
624648
<label class="control-label" for="inputSuccess1">Input with success</label>
625-
<input type="text" class="form-control" id="inputSuccess1">
649+
<input type="text" class="form-control" id="inputSuccess1" aria-describedby="helpBlock2">
650+
<span id="helpBlock2" class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>
626651
</div>
627652
<div class="form-group has-warning">
628653
<label class="control-label" for="inputWarning1">Input with warning</label>
@@ -661,7 +686,8 @@ <h4>Conveying validation state to assistive technologies and colorblind users</h
661686
{% highlight html %}
662687
<div class="form-group has-success">
663688
<label class="control-label" for="inputSuccess1">Input with success</label>
664-
<input type="text" class="form-control" id="inputSuccess1">
689+
<input type="text" class="form-control" id="inputSuccess1" aria-describedby="helpBlock2">
690+
<span id="helpBlock2" class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>
665691
</div>
666692
<div class="form-group has-warning">
667693
<label class="control-label" for="inputWarning1">Input with warning</label>
@@ -1001,25 +1027,3 @@ <h3>Column sizing</h3>
10011027
</div>
10021028
{% endhighlight %}
10031029

1004-
<h2 id="forms-help-text">Help text</h2>
1005-
<p>Block level help text for form controls.</p>
1006-
<div class="bs-callout bs-callout-info" id="callout-help-text-accessibility">
1007-
<h4>Associating help text with form controls</h4>
1008-
<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>
1009-
</div>
1010-
<div class="bs-example" data-example-id="simple-help-text">
1011-
<form>
1012-
<div class="form-group">
1013-
<label for="inputHelpBlock">Input with help text</label>
1014-
<input type="text" id="inputHelpBlock" class="form-control" aria-describedby="helpBlock">
1015-
</div>
1016-
<span id="helpBlock" class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>
1017-
</form>
1018-
</div><!-- /.bs-example -->
1019-
{% highlight html %}
1020-
<label class="sr-only" for="inputHelpBlock">Input with help text</label>
1021-
<input type="text" id="inputHelpBlock" class="form-control" aria-describedby="helpBlock">
1022-
...
1023-
<span id="helpBlock" class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>
1024-
{% endhighlight %}
1025-
</div>

docs/_includes/nav/components.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
<li><a href="#input-groups-buttons">Button addons</a></li>
4646
<li><a href="#input-groups-buttons-dropdowns">Buttons with dropdowns</a></li>
4747
<li><a href="#input-groups-buttons-segmented">Segmented buttons</a></li>
48+
<li><a href="#input-groups-buttons-multiple">Multiple buttons</a></li>
4849
</ul>
4950
</li>
5051
<li>

docs/_includes/nav/css.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@
7373
<li><a href="#forms-control-focus">Focus state</a></li>
7474
<li><a href="#forms-control-disabled">Disabled state</a></li>
7575
<li><a href="#forms-control-readonly">Readonly state</a></li>
76+
<li><a href="#forms-help-text">Help text</a></li>
7677
<li><a href="#forms-control-validation">Validation states</a></li>
7778
<li><a href="#forms-control-sizes">Control sizing</a></li>
78-
<li><a href="#forms-help-text">Help text</a></li>
7979
</ul>
8080
</li>
8181
<li>

0 commit comments

Comments
 (0)