Remove "for" from start/end date labels

The "for" value pointed to an ID for an input that didn't exist, which
caused screenreaders to not read the value of the label when
specififying readthrough dates. Removing the
'for' tags makes the screenreader read the label as expected since the
label wraps the input, so we don't need a 'for'.
This commit is contained in:
Christa Hartsock 2020-11-08 13:40:36 -08:00
parent b684e929b4
commit 2e944bceb9
2 changed files with 7 additions and 7 deletions

View file

@ -96,16 +96,16 @@
<div class="toggle-content hidden">
<div class="box">
<form name="edit-readthrough" action="/edit-readthrough" method="post">
{% csrf_token %}
<input type="hidden" name="id" value="{{ readthrough.id }}">
{% csrf_token %}
<input type="hidden" name="id" value="{{ readthrough.id }}">
<div class="field">
<label class="label" for="start_date">
<label class="label">
Started reading
<input type="date" name="start_date" class="input" id="id_start_date-{{ readthrough.id }}" value="{{ readthrough.start_date | date:"Y-m-d" }}">
</label>
</div>
<div class="field">
<label class="label" for="finish_date">
<label class="label">
Finished reading
<input type="date" name="finish_date" class="input" id="id_finish_date-{{ readthrough.id }}" value="{{ readthrough.finish_date | date:"Y-m-d" }}">
</label>

View file

@ -71,7 +71,7 @@
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}">
<div class="field">
<label class="label" for="start_date">
<label class="label">
Started reading
<input type="date" name="start_date" class="input" id="start_id_start_date-{{ uuid }}" value="{% now "Y-m-d" %}">
</label>
@ -114,13 +114,13 @@
<input type="hidden" name="book" value="{{ book.id }}">
<input type="hidden" name="id" value="{{ readthrough.id }}">
<div class="field">
<label class="label" for="start_date">
<label class="label">
Started reading
<input type="date" name="start_date" class="input" id="finish_id_start_date-{{ uuid }}" value="{{ readthrough.start_date | date:"Y-m-d" }}">
</label>
</div>
<div class="field">
<label class="label" for="finish_date">
<label class="label">
Finished reading
<input type="date" name="finish_date" class="input" id="id_finish_date-{{ uuid }}" value="{% now "Y-m-d" %}">
</label>