summaryrefslogtreecommitdiffstats
path: root/site/content/docs/5.3/forms
diff options
context:
space:
mode:
Diffstat (limited to 'site/content/docs/5.3/forms')
-rw-r--r--site/content/docs/5.3/forms/checks-radios.md29
-rw-r--r--site/content/docs/5.3/forms/floating-labels.md2
-rw-r--r--site/content/docs/5.3/forms/form-control.md6
-rw-r--r--site/content/docs/5.3/forms/select.md8
4 files changed, 33 insertions, 12 deletions
diff --git a/site/content/docs/5.3/forms/checks-radios.md b/site/content/docs/5.3/forms/checks-radios.md
index 13a5091..a18ab38 100644
--- a/site/content/docs/5.3/forms/checks-radios.md
+++ b/site/content/docs/5.3/forms/checks-radios.md
@@ -250,18 +250,25 @@ Create button-like checkboxes and radio buttons by using `.btn` styles rather th
{{< example >}}
<input type="checkbox" class="btn-check" id="btn-check" autocomplete="off">
<label class="btn btn-primary" for="btn-check">Single toggle</label>
-{{< /example >}}
-{{< example >}}
<input type="checkbox" class="btn-check" id="btn-check-2" checked autocomplete="off">
<label class="btn btn-primary" for="btn-check-2">Checked</label>
-{{< /example >}}
-{{< example >}}
<input type="checkbox" class="btn-check" id="btn-check-3" autocomplete="off" disabled>
<label class="btn btn-primary" for="btn-check-3">Disabled</label>
{{< /example >}}
+{{< example >}}
+<input type="checkbox" class="btn-check" id="btn-check-4" autocomplete="off">
+<label class="btn" for="btn-check-4">Single toggle</label>
+
+<input type="checkbox" class="btn-check" id="btn-check-5" checked autocomplete="off">
+<label class="btn" for="btn-check-5">Checked</label>
+
+<input type="checkbox" class="btn-check" id="btn-check-6" autocomplete="off" disabled>
+<label class="btn" for="btn-check-6">Disabled</label>
+{{< /example >}}
+
{{< callout info >}}
Visually, these checkbox toggle buttons are identical to the [button plugin toggle buttons]({{< docsref "/components/buttons#button-plugin" >}}). However, they are conveyed differently by assistive technologies: the checkbox toggles will be announced by screen readers as "checked"/"not checked" (since, despite their appearance, they are fundamentally still checkboxes), whereas the button plugin toggle buttons will be announced as "button"/"button pressed". The choice between these two approaches will depend on the type of toggle you are creating, and whether or not the toggle will make sense to users when announced as a checkbox or as an actual button.
{{< /callout >}}
@@ -282,6 +289,20 @@ Visually, these checkbox toggle buttons are identical to the [button plugin togg
<label class="btn btn-secondary" for="option4">Radio</label>
{{< /example >}}
+{{< example >}}
+<input type="radio" class="btn-check" name="options-base" id="option5" autocomplete="off" checked>
+<label class="btn" for="option5">Checked</label>
+
+<input type="radio" class="btn-check" name="options-base" id="option6" autocomplete="off">
+<label class="btn" for="option6">Radio</label>
+
+<input type="radio" class="btn-check" name="options-base" id="option7" autocomplete="off" disabled>
+<label class="btn" for="option7">Disabled</label>
+
+<input type="radio" class="btn-check" name="options-base" id="option8" autocomplete="off">
+<label class="btn" for="option8">Radio</label>
+{{< /example >}}
+
### Outlined styles
Different variants of `.btn`, such at the various outlined styles, are supported.
diff --git a/site/content/docs/5.3/forms/floating-labels.md b/site/content/docs/5.3/forms/floating-labels.md
index a65a857..9a390e4 100644
--- a/site/content/docs/5.3/forms/floating-labels.md
+++ b/site/content/docs/5.3/forms/floating-labels.md
@@ -89,7 +89,7 @@ Add the `disabled` boolean attribute on an input, a textarea or a select to give
<label for="floatingTextareaDisabled">Comments</label>
</div>
<div class="form-floating mb-3">
- <textarea class="form-control" placeholder="Leave a comment here" id="floatingTextarea2Disabled" style="height: 100px" disabled></textarea>
+ <textarea class="form-control" placeholder="Leave a comment here" id="floatingTextarea2Disabled" style="height: 100px" disabled>Disabled textarea with some text inside</textarea>
<label for="floatingTextarea2Disabled">Comments</label>
</div>
<div class="form-floating">
diff --git a/site/content/docs/5.3/forms/form-control.md b/site/content/docs/5.3/forms/form-control.md
index 0c6b599..1f3474d 100644
--- a/site/content/docs/5.3/forms/form-control.md
+++ b/site/content/docs/5.3/forms/form-control.md
@@ -36,14 +36,14 @@ Set heights using classes like `.form-control-lg` and `.form-control-sm`.
Block-level or inline-level form text can be created using `.form-text`.
{{< callout warning >}}
-Form text should be explicitly associated with the form control it relates to using the `aria-labelledby` (for mandatory information such as data format) or `aria-describedby` (for complementary information) attribute. This will ensure that assistive technologies—such as screen readers—will announce this form text when the user focuses or enters the control.
+Form text should be explicitly associated with the form control it relates to using the `aria-describedby` attribute. This will ensure that assistive technologies—such as screen readers—will announce this form text when the user focuses or enters the control.
{{< /callout >}}
Form text below inputs can be styled with `.form-text`. If a block-level element will be used, a top margin is added for easy spacing from the inputs above.
{{< example >}}
<label for="inputPassword5" class="form-label">Password</label>
-<input type="password" id="inputPassword5" class="form-control" aria-labelledby="passwordHelpBlock">
+<input type="password" id="inputPassword5" class="form-control" aria-describedby="passwordHelpBlock">
<div id="passwordHelpBlock" class="form-text">
Your password must be 8-20 characters long, contain letters and numbers, and must not contain spaces, special characters, or emoji.
</div>
@@ -57,7 +57,7 @@ Inline text can use any typical inline HTML element (be it a `<span>`, `<small>`
<label for="inputPassword6" class="col-form-label">Password</label>
</div>
<div class="col-auto">
- <input type="password" id="inputPassword6" class="form-control" aria-labelledby="passwordHelpInline">
+ <input type="password" id="inputPassword6" class="form-control" aria-describedby="passwordHelpInline">
</div>
<div class="col-auto">
<span id="passwordHelpInline" class="form-text">
diff --git a/site/content/docs/5.3/forms/select.md b/site/content/docs/5.3/forms/select.md
index 07ee8c8..c58fdf7 100644
--- a/site/content/docs/5.3/forms/select.md
+++ b/site/content/docs/5.3/forms/select.md
@@ -24,14 +24,14 @@ Custom `<select>` menus need only a custom class, `.form-select` to trigger the
You may also choose from small and large custom selects to match our similarly sized text inputs.
{{< example >}}
-<select class="form-select form-select-lg mb-3" aria-label=".form-select-lg example">
+<select class="form-select form-select-lg mb-3" aria-label="Large select example">
<option selected>Open this select menu</option>
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
-<select class="form-select form-select-sm" aria-label=".form-select-sm example">
+<select class="form-select form-select-sm" aria-label="Small select example">
<option selected>Open this select menu</option>
<option value="1">One</option>
<option value="2">Two</option>
@@ -42,7 +42,7 @@ You may also choose from small and large custom selects to match our similarly s
The `multiple` attribute is also supported:
{{< example >}}
-<select class="form-select" multiple aria-label="multiple select example">
+<select class="form-select" multiple aria-label="Multiple select example">
<option selected>Open this select menu</option>
<option value="1">One</option>
<option value="2">Two</option>
@@ -53,7 +53,7 @@ The `multiple` attribute is also supported:
As is the `size` attribute:
{{< example >}}
-<select class="form-select" size="3" aria-label="size 3 select example">
+<select class="form-select" size="3" aria-label="Size 3 select example">
<option selected>Open this select menu</option>
<option value="1">One</option>
<option value="2">Two</option>