File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
NHSUKViewComponents.Web/Views/Shared/Components/RadioList Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 44
44
45
45
@if (Model .Required && ! Model .HasError )
46
46
{
47
- <div data-valmsg-for =" @Model.AspFor" data-valmsg-replace =" true" class =" error-message--margin-bottom-1 nhsuk-error-message field-validation-valid nhsuk-u-padding-top-1 nhsuk-u-padding-bottom-3" >
47
+ <div data-valmsg-for =" @Model.AspFor" data-valmsg-replace =" true" class =" error-message--margin-bottom-1 nhsuk-error-message field-validation-valid nhsuk-u-padding-top-1 nhsuk-u-padding-bottom-3" aria-live = " assertive " role = " alert " >
48
48
</div >
49
49
}
50
50
131
131
132
132
</div >
133
133
</fieldset >
134
+ <script >
135
+ window .onload = function () {
136
+ const id = " @Model.AspFor" ;
137
+ const radioForm = document .querySelector (" main form[novalidate='novalidate']" );
138
+ radioForm .addEventListener (" submit" , () => {
139
+ const errorMessageParent = document .querySelector (" div[data-valmsg-for='" + id + " ']" );
140
+ const errorMessage = errorMessageParent .innerHTML ;
141
+ errorMessageParent .innerHTML = " " ;
134
142
143
+ setTimeout (function () {
144
+ errorMessageParent .innerHTML = errorMessage;
145
+ }, 0 );
146
+ });
147
+ };
148
+ </script >
135
149
</div >
You can’t perform that action at this time.
0 commit comments