File tree Expand file tree Collapse file tree 3 files changed +11
-31
lines changed
LearningHub.Nhs.WebUI/Views/Shared/Components Expand file tree Collapse file tree 3 files changed +11
-31
lines changed Original file line number Diff line number Diff line change 5454 id =" @Model.DayId"
5555 name =" @Model.DayId"
5656 value =" @Model.DayValue"
57- type =" text"
57+ type =" number"
58+ pattern =" [0-9]*"
5859 min =" 1"
5960 max =" 31"
6061 step =" 1"
61- inputmode =" numeric"
62- aria-describedby =" date-error" aria-invalid =" false" />
62+ inputmode =" numeric" />
6363 </div >
6464 </div >
6565 <div class =" nhsuk-date-input__item" >
6969 id =" @Model.MonthId"
7070 name =" @Model.MonthId"
7171 value =" @Model.MonthValue"
72- type =" text"
72+ type =" number"
73+ pattern =" [0-9]*"
7374 min =" 1"
7475 max =" 12"
7576 step =" 1"
76- inputmode =" numeric"
77- aria-describedby =" date-error" aria-invalid =" false" />
77+ inputmode =" numeric" />
7878 </div >
7979 </div >
8080 <div class =" nhsuk-date-input__item" >
8484 id =" @Model.YearId"
8585 name =" @Model.YearId"
8686 value =" @Model.YearValue"
87- type =" text"
87+ type =" number"
88+ pattern =" [0-9]*"
8889 min =" 1900"
8990 max =" 9999"
9091 step =" 1"
91- inputmode =" numeric"
92- aria-describedby =" date-error" aria-invalid =" false" />
92+ inputmode =" numeric" />
9393 </div >
9494 </div >
95- <span id =" date-error" class =" error-message--margin-bottom-1 nhsuk-error-message" aria-live =" polite" style =" visibility : hidden ;" >
96- </span >
9795 </div >
9896 </fieldset >
99- </div >
97+ </div >
Original file line number Diff line number Diff line change 2121 < / ul >
2222 < / div >
2323 < / div >
24- < script >
25- const errorSummary = document .querySelector (" #error-summary-title" ).parentElement ;
26- errorSummary .focus ();
27- </script >
2824}
2925else
3026{
Original file line number Diff line number Diff line change 4444
4545 @if (Model .Required && ! Model .HasError )
4646 {
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 " >
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" >
4848 </div >
4949 }
5050
131131
132132 </div >
133133 </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 = " " ;
142134
143- setTimeout (function () {
144- errorMessageParent .innerHTML = errorMessage;
145- }, 0 );
146- });
147- };
148- </script >
149135</div >
You can’t perform that action at this time.
0 commit comments