Skip to content

Commit

Permalink
added legends back to fieldset to comply with accessibility standards
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielClarkeEducation committed Jul 4, 2024
1 parent 1c75a9c commit bdb7519
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
@Model.Question
</h1>
</legend>

<div id="date-format-hint" class="govuk-hint">@Model.QuestionHint</div>

@if (Model.HasErrors)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,27 @@
{
<fieldset class="govuk-fieldset govuk-!-margin-bottom-4">
<div class="govuk-form-group @(Model.HasErrors ? "govuk-form-group--error" : "")">
<h1 class="govuk-heading-l" id="question">
@Model.Question
</h1>

<legend class="govuk-fieldset__legend govuk-fieldset__legend--l">
<h1 class="govuk-heading-l" id="question">
@Model.Question
</h1>
</legend>

<h1 class="govuk-label-wrapper">
@Html.Label(Model.DropdownId, Model.DropdownHeading, new { @class = "govuk-label govuk-fieldset__legend--m" })
</h1>

@if (Model.HasErrors)
{
<p id="dropdown-error" class="govuk-error-message">
<span class="govuk-visually-hidden">Error:</span> @Model.ErrorMessage
</p>
<p id="dropdown-error" class="govuk-error-message">
<span class="govuk-visually-hidden">Error:</span> @Model.ErrorMessage
</p>
}

<div class="govuk-form-group">
@Html.DropDownListFor(x => x.SelectedValue, Model.Values, new { @class = Model.HasErrors ? "govuk-select govuk-select--error" : "govuk-select", id = Model.DropdownId })
</div>

<div class="govuk-checkboxes__item">
@Html.CheckBoxFor(x => x.NotInTheList, new { @class = "govuk-checkboxes__input", id = Model.CheckboxId, name = "awarding-organisation" })
@Html.Label(Model.CheckboxId, Model.NotInListText, new { @class = "govuk-label govuk-checkboxes__label" })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
{
<fieldset class="govuk-fieldset govuk-!-margin-bottom-4">
<div class="govuk-form-group @(Model.HasErrors ? "govuk-form-group--error" : "")">
<h1 class="govuk-heading-l" id="question">
@Model.Question
</h1>
<legend class="govuk-fieldset__legend govuk-fieldset__legend--l">
<h1 class="govuk-heading-l" id="question">
@Model.Question
</h1>
</legend>

@if (!string.IsNullOrEmpty(Model.AdditionalInformationHeader) && !string.IsNullOrEmpty(Model.AdditionalInformationBody))
{
Expand Down

0 comments on commit bdb7519

Please sign in to comment.