|
34 | 34 | <div class="${fieldClassName}"> |
35 | 35 | <label for="${field.formRelativeUniqueName}" class="eforms-label">${field.label!}<span class="eforms-req">${field.requiredMarker!}</span></label> |
36 | 36 | <input type="text" name="${field.formRelativeUniqueName}" id="${field.formRelativeUniqueName}" class="${field.styleClass!}" autocomplete="off" value="${field.value!}" |
37 | | - <#if (field.length > 0)>size="${field.length}"</#if> <#if (field.minLength > 0)>minlength="${removeCommas(field.minLength)}"</#if> <#if (field.maxLength > 0)>maxlength="${removeCommas(field.maxLength)}"</#if> /> |
| 37 | + <#if (field.length > 0)>size="${field.length}"</#if> <#if (field.minLength > 0)>minlength="${removeCommas(field.minLength)}"</#if> <#if (field.maxLength > 0)>maxlength="${removeCommas(field.maxLength)}"</#if> aria-describedby="${field.formRelativeUniqueName}-hint" /> |
38 | 38 | <@renderError errorMessage = error /> |
39 | | - <span class="eforms-hint">${field.hint!}</span> |
| 39 | + <span class="eforms-hint" id="${field.formRelativeUniqueName}-hint">${field.hint!}</span> |
40 | 40 | </div> |
41 | 41 | <#elseif field.type == "custompostcodefield"> |
42 | 42 | <div class="${fieldClassName}"> |
43 | 43 | <label for="${field.formRelativeUniqueName}" class="eforms-label">${field.label!}<span class="eforms-req">${field.requiredMarker!}</span></label> |
44 | | - <input type="text" name="${field.formRelativeUniqueName}" id="${field.formRelativeUniqueName}" class="${field.styleClass!}" autocomplete="off" value="${field.value!}"/> |
| 44 | + <input type="text" name="${field.formRelativeUniqueName}" id="${field.formRelativeUniqueName}" class="${field.styleClass!}" autocomplete="off" value="${field.value!}" aria-describedby="${field.formRelativeUniqueName}-hint"/> |
45 | 45 | <@renderError errorMessage = error /> |
46 | | - <span class="eforms-hint">${field.hint!}</span> |
| 46 | + <span class="eforms-hint" id="${field.formRelativeUniqueName}-hint">${field.hint!}</span> |
47 | 47 | </div> |
48 | 48 |
|
49 | 49 | <#elseif field.type == "customdatefield"> |
|
61 | 61 |
|
62 | 62 | <input type="text" name="${field.formRelativeUniqueName}" |
63 | 63 | id="date__DD" class="${field.styleClass!}" |
64 | | - autocomplete="off" value="${field.value!}" size="1"/> |
| 64 | + autocomplete="off" value="${field.value!}" size="1" |
| 65 | + aria-describedby="${field.formRelativeUniqueName}-hint"/> |
65 | 66 | </div> |
66 | 67 |
|
67 | 68 | <div style="margin-right: 12px;margin-top: 0px"> |
|
72 | 73 | id="date__MM" |
73 | 74 | class="${field.styleClass!}" |
74 | 75 | autocomplete="off" value="${field.value!}" |
75 | | - size="1"/> |
| 76 | + size="1" |
| 77 | + aria-describedby="${field.formRelativeUniqueName}-hint"/> |
76 | 78 | </div> |
77 | 79 |
|
78 | 80 | <div class="nhsd-m-date-input-year" style="margin-top: 0px"> |
|
82 | 84 | <input type="text" name="${field.formRelativeUniqueName}" |
83 | 85 | id="date__YYYY" |
84 | 86 | class="${field.styleClass!}" |
85 | | - autocomplete="off" value="${field.value!}" size="3"/> |
| 87 | + autocomplete="off" value="${field.value!}" size="3" |
| 88 | + aria-describedby="${field.formRelativeUniqueName}-hint"/> |
86 | 89 | </div> |
87 | 90 | <input type="hidden" name="${field.formRelativeUniqueName}" |
88 | 91 | class="visually-hidden" |
|
91 | 94 | <@renderError errorMessage = error /> |
92 | 95 |
|
93 | 96 | </div> |
94 | | - <span class="eforms-hint">${field.hint!}</span> |
| 97 | + <span class="eforms-hint" id="${field.formRelativeUniqueName}-hint">${field.hint!}</span> |
95 | 98 | </div> |
96 | 99 |
|
97 | 100 |
|
|
101 | 104 | <div class="${fieldClassName}"> |
102 | 105 | <label for="${field.formRelativeUniqueName}" class="eforms-label">${field.label!}<span class="eforms-req">${field.requiredMarker!}</span></label> |
103 | 106 | <input type="password" name="${field.formRelativeUniqueName}" id="${field.formRelativeUniqueName}" autocomplete="off" class="${field.styleClass!}" |
104 | | - <#if (field.length > 0)>size="${field.length}"</#if> <#if (field.minLength > 0)>minlength="${removeCommas(field.minLength)}"</#if> <#if (field.maxLength > 0)>maxlength="${removeCommas(field.maxLength)}"</#if> /> |
| 107 | + <#if (field.length > 0)>size="${field.length}"</#if> <#if (field.minLength > 0)>minlength="${removeCommas(field.minLength)}"</#if> <#if (field.maxLength > 0)>maxlength="${removeCommas(field.maxLength)}"</#if> aria-describedby="${field.formRelativeUniqueName}-hint" /> |
105 | 108 | <@renderError errorMessage = error /> |
106 | | - <span class="eforms-hint">${field.hint!}</span> |
| 109 | + <span class="eforms-hint" id="${field.formRelativeUniqueName}-hint">${field.hint!}</span> |
107 | 110 | </div> |
108 | 111 | <#elseif field.type == "textarea"> |
109 | 112 | <div class="${fieldClassName}"> |
110 | 113 | <label for="${field.formRelativeUniqueName}" class="eforms-label">${field.label!}<span class="eforms-req">${field.requiredMarker!}</span></label> |
111 | 114 | <textarea name="${field.formRelativeUniqueName}" id="${field.formRelativeUniqueName}" autocomplete="off" class="${field.styleClass!}" |
112 | 115 | cols="${field.cols}" rows="${field.rows}" |
113 | | - <#if (field.minLength > 0)>minlength="${removeCommas(field.minLength)}"</#if> <#if (field.maxLength > 0)>maxlength="${removeCommas(field.maxLength)}"</#if>>${field.value!}</textarea> |
| 116 | + <#if (field.minLength > 0)>minlength="${removeCommas(field.minLength)}"</#if> <#if (field.maxLength > 0)>maxlength="${removeCommas(field.maxLength)}"</#if> |
| 117 | + aria-describedby="${field.formRelativeUniqueName}-hint">${field.value!}</textarea> |
114 | 118 | <@renderError errorMessage = error /> |
115 | | - <span class="eforms-hint">${field.hint!}</span> |
| 119 | + <span class="eforms-hint" id="${field.formRelativeUniqueName}-hint">${field.hint!}</span> |
116 | 120 | </div> |
117 | 121 | <#elseif field.type == "dropdown"> |
118 | 122 | <div class="${fieldClassName}"> |
119 | 123 | <label for="${field.formRelativeUniqueName}" class="eforms-label">${field.label!}<span class="eforms-req">${field.requiredMarker!}</span></label> |
120 | | - <select name="${field.formRelativeUniqueName}" id="${field.formRelativeUniqueName}" class="${field.styleClass!}"> |
| 124 | + <select name="${field.formRelativeUniqueName}" id="${field.formRelativeUniqueName}" class="${field.styleClass!}" aria-describedby="${field.formRelativeUniqueName}-hint"> |
121 | 125 | <#list field.options as option> |
122 | 126 | <option value="${option.value!}" <#if option.selected>selected="selected"</#if>>${option.text!}</option> |
123 | 127 | </#list> |
124 | 128 | </select> |
125 | 129 | <@renderError errorMessage = error /> |
126 | | - <span class="eforms-hint">${field.hint!}</span> |
| 130 | + <span class="eforms-hint" id="${field.formRelativeUniqueName}-hint">${field.hint!}</span> |
127 | 131 | </div> |
128 | 132 | <#elseif field.type == "fileuploadfield"> |
129 | 133 | <div class="${fieldClassName}"> |
130 | 134 | <label for="${field.formRelativeUniqueName}" class="eforms-label">${field.label!}<span class="eforms-req">${field.requiredMarker!}</span></label> |
131 | 135 | <input type="file" name="${field.formRelativeUniqueName}" id="${field.formRelativeUniqueName}" class="${field.styleClass!}" |
132 | 136 | data-validate="fileSizeAndExtension" data-max-size="${field.maxUploadSize}" |
133 | | - data-allowed-extensions="<#if field.fileExtensions?? && (field.fileExtensions?size > 0)>${field.fileExtensions?join(",")}</#if>" /> |
| 137 | + data-allowed-extensions="<#if field.fileExtensions?? && (field.fileExtensions?size > 0)>${field.fileExtensions?join(",")}</#if>" |
| 138 | + aria-describedby="${field.formRelativeUniqueName}-hint" /> |
134 | 139 | <@renderError errorMessage = error /> |
135 | | - <span class="eforms-hint">${field.hint!}</span> |
| 140 | + <span class="eforms-hint" id="${field.formRelativeUniqueName}-hint">${field.hint!}</span> |
136 | 141 | </div> |
137 | 142 |
|
138 | 143 | <#elseif field.type == "datefield"> |
|
142 | 147 | </#if> |
143 | 148 |
|
144 | 149 | <label for="${field.formRelativeUniqueName}" class="eforms-label">${field.label!}<span class="eforms-req">${field.requiredMarker!}</span></label> |
145 | | - <input type="text" name="${field.formRelativeUniqueName}" id="${field.formRelativeUniqueName}" class="date ${field.styleClass!}" value="${value!}" autocomplete="off" /> |
| 150 | + <input type="text" name="${field.formRelativeUniqueName}" id="${field.formRelativeUniqueName}" class="date ${field.styleClass!}" value="${value!}" autocomplete="off" aria-describedby="${field.formRelativeUniqueName}-hint" /> |
146 | 151 | <@renderError errorMessage = error /> |
147 | | - <span class="eforms-hint">${field.hint!}</span> |
| 152 | + <span class="eforms-hint" id="${field.formRelativeUniqueName}-hint">${field.hint!}</span> |
148 | 153 | </div> |
149 | 154 | <#elseif field.type == "radiogroup"> |
150 | 155 | <div class="${fieldClassName}"> |
|
153 | 158 | <#list field.fields as radio> |
154 | 159 | <li> |
155 | 160 | <label for="${slugify(field.formRelativeUniqueName)}-${slugify(radio.value!)}"> |
156 | | - <input type="radio" name="${field.formRelativeUniqueName}" id="${slugify(field.formRelativeUniqueName)}-${slugify(radio.value!)}" class="${radio.styleClass!}" value="${radio.value!}" <#if radio.checked>checked="true"</#if> /> |
| 161 | + <input type="radio" name="${field.formRelativeUniqueName}" id="${slugify(field.formRelativeUniqueName)}-${slugify(radio.value!)}" class="${radio.styleClass!}" value="${radio.value!}" <#if radio.checked>checked="true"</#if> aria-describedby="${field.formRelativeUniqueName}-hint" /> |
157 | 162 | ${radio.label!} |
158 | 163 | </label> |
159 | 164 | </li> |
160 | 165 | </#list> |
161 | 166 | <#if field.allowOther> |
162 | 167 | <li> |
163 | 168 | <label for="${slugify(field.formRelativeUniqueName)}-${slugify(field.renderOtherValue!)}"> |
164 | | - <input type="radio" name="${field.formRelativeUniqueName}" id="${slugify(field.formRelativeUniqueName)}-${slugify(field.renderOtherValue!)}" class="${field.styleClass!}" value="${field.renderOtherValue!}" <#if field.otherValue>checked="true"</#if> /> Other: |
| 169 | + <input type="radio" name="${field.formRelativeUniqueName}" id="${slugify(field.formRelativeUniqueName)}-${slugify(field.renderOtherValue!)}" class="${field.styleClass!}" value="${field.renderOtherValue!}" <#if field.otherValue>checked="true"</#if> aria-describedby="${field.formRelativeUniqueName}-hint" /> Other: |
165 | 170 | </label> |
166 | 171 | <input type="text" value="<#if field.otherValue>${field.value!}</#if>" name="${field.otherFieldName!}" id="${slugify(field.formRelativeUniqueName)}-${slugify(field.otherFieldName!)}" autocomplete="off" class="textfield-other" <#if (field.length > 0)>size="${field.length}"</#if> <#if (field.minLength > 0)>minlength="${removeCommas(field.minLength)}"</#if> <#if (field.maxLength > 0)>maxlength="${removeCommas(field.maxLength)}"</#if> /> |
167 | 172 | <label for="${slugify(field.formRelativeUniqueName)}-${slugify(field.otherFieldName!)}" class="visually-hidden">Other:</label> |
168 | 173 | </li> |
169 | 174 | </#if> |
170 | 175 | </ul> |
171 | 176 | <@renderError errorMessage = error /> |
172 | | - <span class="eforms-hint">${field.hint!}</span> |
| 177 | + <span class="eforms-hint" id="${field.formRelativeUniqueName}-hint">${field.hint!}</span> |
173 | 178 | </div> |
174 | 179 | <#elseif field.type == "checkboxgroup"> |
175 | 180 | <div class="${fieldClassName}"> |
|
179 | 184 | <li> |
180 | 185 | <label for="${slugify(checkbox.formRelativeUniqueName)}-${slugify(checkbox.value)}"> |
181 | 186 | <input type="checkbox" name="${checkbox.formRelativeUniqueName}" id="${slugify(checkbox.formRelativeUniqueName)}-${slugify(checkbox.value)}" class="${checkbox.styleClass!}" value="${checkbox.value!}" |
182 | | - <#if checkbox.checked>checked="true"</#if> />${checkbox.label!} |
| 187 | + <#if checkbox.checked>checked="true"</#if> aria-describedby="${field.formRelativeUniqueName}-hint" />${checkbox.label!} |
183 | 188 | </label> |
184 | 189 | </li> |
185 | 190 | </#list> |
186 | 191 | <#if field.allowOther> |
187 | 192 | <li> |
188 | 193 | <label for="${slugify(field.formRelativeUniqueName)}-${slugify(field.renderOtherValue!)}" > |
189 | 194 | <input type="checkbox" name="${field.formRelativeUniqueName}" id="${slugify(field.formRelativeUniqueName)}-${slugify(field.renderOtherValue!)}" class="${field.styleClass!}" value="${field.renderOtherValue!}" |
190 | | - <#if field.otherValue>checked="true"</#if> />Other: |
| 195 | + <#if field.otherValue>checked="true"</#if> aria-describedby="${field.formRelativeUniqueName}-hint" />Other: |
191 | 196 | </label> |
192 | 197 | <input type="text" value="<#if field.otherValue>${field.value!}</#if>" name="${field.otherFieldName!}" id="${slugify(field.formRelativeUniqueName)}-${slugify(field.otherFieldName!)}" autocomplete="off" class="textfield-other" |
193 | 198 | <#if (field.length > 0)>size="${field.length}"</#if> <#if (field.minLength > 0)>minlength="${removeCommas(field.minLength)}"</#if> <#if (field.maxLength > 0)>maxlength="${removeCommas(field.maxLength)}"</#if> /> |
|
196 | 201 | </#if> |
197 | 202 | </ul> |
198 | 203 | <@renderError errorMessage = error /> |
199 | | - <span class="eforms-hint">${field.hint!}</span> |
| 204 | + <span class="eforms-hint" id="${field.formRelativeUniqueName}-hint">${field.hint!}</span> |
200 | 205 | </div> |
201 | 206 | <#elseif field.type == "likert"> |
202 | 207 | <div class="${fieldClassName}"> |
|
217 | 222 | <#list pair.value as radio> |
218 | 223 | <td> |
219 | 224 | <input type="radio" name="${radio.formRelativeUniqueName}" id="${slugify(radio.formRelativeUniqueName)}-${slugify(radio.value)}" class="${radio.styleClass!}" value="${radio.value!}" |
220 | | - <#if radio.checked>checked="true"</#if> /> |
| 225 | + <#if radio.checked>checked="true"</#if> aria-describedby="${field.formRelativeUniqueName}-hint" /> |
221 | 226 | <label for="${slugify(radio.formRelativeUniqueName)}-${slugify(radio.value)}" class="visually-hidden">${radio.value!}</label> |
222 | 227 | </td> |
223 | 228 | </#list> |
224 | 229 | </tr> |
225 | 230 | </#list> |
226 | 231 | </table> |
227 | 232 | <@renderError errorMessage = error /> |
228 | | - <span class="eforms-hint">${field.hint!}</span> |
| 233 | + <span class="eforms-hint" id="${field.formRelativeUniqueName}-hint">${field.hint!}</span> |
229 | 234 | </div> |
230 | 235 |
|
231 | 236 | </#if> |
|
0 commit comments