From 43e45ce06c99f148308a068e69330f4771608d31 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 19 Jan 2015 16:00:56 -0800 Subject: consolidate forms docs --- docs/content/forms.md | 82 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 69 insertions(+), 13 deletions(-) (limited to 'docs/content') diff --git a/docs/content/forms.md b/docs/content/forms.md index 1cf1e9c8e..b538a586e 100644 --- a/docs/content/forms.md +++ b/docs/content/forms.md @@ -40,10 +40,10 @@ Individual form controls automatically receive some global styling. All textual ## Inline forms -Add `.form-inline` to your `
` for left-aligned and inline-block controls. **This only applies to forms within viewports that are at least 768px wide.** +Add `.form-inline` to your `` or a parent element for left-aligned and inline-block controls. **This only applies to form controls within viewports that are at least 768px wide.**
-

Requires custom widths

+

May require custom widths

Inputs and selects have `width: 100%;` applied by default in Bootstrap. Within inline forms, we reset that to `width: auto;` so multiple controls can reside on the same line. Depending on your layout, additional custom widths may be required.

@@ -51,15 +51,35 @@ Add `.form-inline` to your `` for left-aligned and inline-block controls.

Screen readers will have trouble with your forms if you don't include a label for every input. For these inline forms, you can hide the labels using the `.sr-only` class.

+### Visible labels + +{% example html %} +
+ +
+ + +
+
+ + +
+ + +
+{% endexample %} + +### Hidden labels + {% example html %}
- - + +
- - + +
+
+
+ +
+
+ @ + +
+ + (success) +
+
{% endexample %} @@ -453,6 +497,18 @@ You can also add optional feedback icons with the addition of `.has-feedback` an {% endexample %} +{% example html %} +
+ +
+ @ + +
+ + (success) +
+{% endexample %} + For form controls with no visible label, add the `.sr-only` class on the label. Bootstrap will automatically adjust the position of the icon once it's been added. {% example html %} -- cgit v1.2.3