Skip to content

Commit c71e08a

Browse files
committed
Updated id for help text to align with aria-describedby attributed added by Django in 5.0+
Django 5.0 added `aria-describedby` to link form inputs to its help text. Align the `id` used for help text so screen readers can make use of the attribute. https://docs.djangoproject.com/en/5.2/releases/5.0/#forms
1 parent 9332442 commit c71e08a

13 files changed

+16
-14
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% if field.help_text %}
22
{% if help_text_inline %}
3-
<span id="hint_{{ field.auto_id }}" class="text-muted">{{ field.help_text|safe }}</span>
3+
<span id="{{ field.auto_id }}_helptext" class="text-muted">{{ field.help_text|safe }}</span>
44
{% else %}
5-
<small id="hint_{{ field.auto_id }}" class="form-text text-muted">{{ field.help_text|safe }}</small>
5+
<small id="{{ field.auto_id }}_helptext" class="form-text text-muted">{{ field.help_text|safe }}</small>
66
{% endif %}
77
{% endif %}

tests/results/bootstrap4/test_form_helper/bootstrap_form_show_errors_bs4_false.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class="textinput textInput inputtext form-control is-invalid" required id="id_email" />
88
<div class="input-group-append"><span class="input-group-text">whatever</span></div>
99
</div>
10-
<small id="hint_id_email" class="form-text text-muted">Insert your email</small>
10+
<small id="id_email_helptext" class="form-text text-muted">Insert your email</small>
1111
</div>
1212
</div>
1313
<div id="div_id_first_name" class="form-group">

tests/results/bootstrap4/test_form_helper/bootstrap_form_show_errors_bs4_false_lt50.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<input type="text" name="email" value="invalidemail" maxlength="30" class="textinput textInput inputtext form-control is-invalid" required id="id_email" />
77
<div class="input-group-append"><span class="input-group-text">whatever</span></div>
88
</div>
9-
<small id="hint_id_email" class="form-text text-muted">Insert your email</small>
9+
<small id="id_email_helptext" class="form-text text-muted">Insert your email</small>
1010
</div>
1111
</div>
1212
<div id="div_id_first_name" class="form-group">

tests/results/bootstrap4/test_form_helper/bootstrap_form_show_errors_bs4_true.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<div class="input-group-append"><span class="input-group-text">whatever</span></div>
99
<span id="error_1_id_email" class="invalid-feedback"><strong>Enter a valid email address.</strong></span>
1010
</div>
11-
<small id="hint_id_email" class="form-text text-muted">Insert your email</small>
11+
<small id="id_email_helptext" class="form-text text-muted">Insert your email</small>
1212
</div>
1313
</div>
1414
<div id="div_id_first_name" class="form-group">

tests/results/bootstrap4/test_form_helper/bootstrap_form_show_errors_bs4_true_lt50.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="input-group-append"><span class="input-group-text">whatever</span></div>
88
<span id="error_1_id_email" class="invalid-feedback"><strong>Enter a valid email address.</strong></span>
99
</div>
10-
<small id="hint_id_email" class="form-text text-muted">Insert your email</small>
10+
<small id="id_email_helptext" class="form-text text-muted">Insert your email</small>
1111
</div>
1212
</div>
1313
<div id="div_id_first_name" class="form-group">

tests/results/bootstrap4/test_form_helper/test_form_show_errors_non_field_errors_false.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class="asteriskField">*</span> </label>
99
<div> <input type="text" name="email" maxlength="30" aria-describedby="id_email_helptext" aria-invalid="true"
1010
class="textinput textInput inputtext form-control is-invalid" required id="id_email"> <small
11-
id="hint_id_email" class="form-text text-muted">Insert your email</small> </div>
11+
id="id_email_helptext" class="form-text text-muted">Insert your email</small> </div>
1212
</div>
1313
<div id="div_id_password1" class="form-group"> <label for="id_password1" class=" requiredField"> password<span
1414
class="asteriskField">*</span> </label>

tests/results/bootstrap4/test_form_helper/test_form_show_errors_non_field_errors_false_lt50.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class="asteriskField">*</span> </label>
99
<div> <input type="text" name="email" maxlength="30"
1010
class="textinput textInput inputtext form-control is-invalid" required id="id_email"> <small
11-
id="hint_id_email" class="form-text text-muted">Insert your email</small> </div>
11+
id="id_email_helptext" class="form-text text-muted">Insert your email</small> </div>
1212
</div>
1313
<div id="div_id_password1" class="form-group"> <label for="id_password1" class=" requiredField"> password<span
1414
class="asteriskField">*</span> </label>

tests/results/bootstrap4/test_form_helper/test_form_show_errors_non_field_errors_true.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<div> <input type="text" name="email" maxlength="30" aria-describedby="id_email_helptext" aria-invalid="true"
1515
class="textinput textInput inputtext form-control is-invalid" required id="id_email"> <span
1616
id="error_1_id_email" class="invalid-feedback"><strong>This field is required.</strong></span> <small
17-
id="hint_id_email" class="form-text text-muted">Insert your email</small> </div>
17+
id="id_email_helptext" class="form-text text-muted">Insert your email</small> </div>
1818
</div>
1919
<div id="div_id_password1" class="form-group"> <label for="id_password1" class=" requiredField"> password<span
2020
class="asteriskField">*</span> </label>

tests/results/bootstrap4/test_form_helper/test_form_show_errors_non_field_errors_true_lt50.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<div> <input type="text" name="email" maxlength="30"
1515
class="textinput textInput inputtext form-control is-invalid" required id="id_email"> <span
1616
id="error_1_id_email" class="invalid-feedback"><strong>This field is required.</strong></span> <small
17-
id="hint_id_email" class="form-text text-muted">Insert your email</small> </div>
17+
id="id_email_helptext" class="form-text text-muted">Insert your email</small> </div>
1818
</div>
1919
<div id="div_id_password1" class="form-group"> <label for="id_password1" class=" requiredField"> password<span
2020
class="asteriskField">*</span> </label>

tests/results/bootstrap4/test_layout_objects/test_prepended_appended_text.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div class="input-group-append active">
1010
<span class="input-group-text">gmail.com</span>
1111
</div>
12-
</div> <small id="hint_id_email" class="form-text text-muted">Insert your email</small>
12+
</div> <small id="id_email_helptext" class="form-text text-muted">Insert your email</small>
1313
</div>
1414
</div>
1515
<div id="div_id_password1" class="form-group">

0 commit comments

Comments
 (0)