Skip to content

Commit 6553973

Browse files
authored
Merge pull request #486 from TechnologyEnhancedLearning/Develop/Features/TD-4180-Associate-input-error-message
Associate error label with target input and add custom error message for Country Search input errors
2 parents c3fcb9d + 25c7402 commit 6553973

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

LearningHub.Nhs.WebUI/Styles/nhsuk/pages/createaccount.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,9 @@
7272
.no-bottom-border {
7373
border-bottom: 0px;
7474
}
75+
76+
.custom-validation-error {
77+
color: #d5281b;
78+
font-size: 19px;
79+
}
7580
}

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,22 @@
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">
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>
3134
</svg>
3235
<span class="nhsuk-u-visually-hidden">Search</span>
3336
</button>
34-
37+
</div>
38+
<div>
39+
@if (errorHasOccurred)
40+
{
41+
<span id="custom-validation-error" class="custom-validation-error">@CommonValidationErrorMessages.SearchTermRequired</span>
42+
}
3543
</div>
3644
</form>
3745

0 commit comments

Comments
 (0)