Skip to content

Commit 25c7402

Browse files
committed
Add custom input error id to aria-describedby
1 parent ff325b5 commit 25c7402

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

LearningHub.Nhs.WebUI/Views/Account/CreateAccountCountrySearch.cshtml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@
2424
<input type="hidden" name="formSubmission" value="true">
2525
<label for="FilterText" class="nhsuk-body-l nhsuk-u-font-size-19 nhsuk-u-margin-bottom-3">Search for example, England</label>
2626
<div class="nhsuk-form-group search-box-container" style="white-space:nowrap">
27-
<input class="nhsuk-input nhsuk-search__input" type="search" autocomplete="off" id="FilterText" name="FilterText" placeholder="" value="@Model.FilterText" @if(errorHasOccurred){<text>aria-describedby="error-summary-title"</text>}>
27+
<input class="nhsuk-input nhsuk-search__input" type="search" autocomplete="off" id="FilterText" name="FilterText" placeholder="" value="@Model.FilterText" @if (errorHasOccurred)
28+
{
29+
<text>aria-describedby="error-summary-title custom-validation-error"</text>
30+
}>
2831
<button class="nhsuk-search__submit" type="submit">
2932
<svg class="nhsuk-icon nhsuk-icon__search" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
3033
<path d="M19.71 18.29l-4.11-4.1a7 7 0 1 0-1.41 1.41l4.1 4.11a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42zM5 10a5 5 0 1 1 5 5 5 5 0 0 1-5-5z"></path>
@@ -35,7 +38,7 @@
3538
<div>
3639
@if (errorHasOccurred)
3740
{
38-
<span class="custom-validation-error">@CommonValidationErrorMessages.SearchTermRequired</span>
41+
<span id="custom-validation-error" class="custom-validation-error">@CommonValidationErrorMessages.SearchTermRequired</span>
3942
}
4043
</div>
4144
</form>

0 commit comments

Comments
 (0)